RN42 Bluetooth Serial for Amazon Fire Stick

I am creating a HID device to control my Amazon Fire Stick so I can integrate it with my home automation setup.

I have the RN42 all connected and working. I've created a sketch to listen for my request via the USB serial and output TX to the RN42. I've set it up for up, down, left, right, enter, escape and play/pause.

The HEX codes have been cobbled together from what seems like days of tinkering and testing. The code is below, you can see that for most functions, a single hex works. I got those codes from here. The play/pause function is supposed to be a space but I've not been able to find a similar code that works.

So, I've read (and tried to understand!) the official manual and found the solution for play/pause (see code). That seems to work. So I'm almost happy. Except for 1 remaining stumbling block. For fast forward/rewind, you need to be able to "hold down" the left or right keys to seek faster. I can't work out how to do this. I've tried variants of my play/pause function, swapping in the codes from that document to try and find a solution. It seems the only "official" code I can get to work is the play/pause. I'm sure it's got to be something to do with the 'release command'...

Any help or improvements on what I am trying to achieve would be greatly appreciated. Many thanks.

UPDATE: Sorry, I forgot to include the link to the manufacturer's PDF manual.

void setup()

void loop()

String input = "";
while (Serial.available() > 0)
input += (char) Serial.read();

if (input > "") {

//1 left
if (input.charAt(0) == 49) {

//2 right
if (input.charAt(0) == 50) {

//3 up
if (input.charAt(0) == 51) {

//4 down
if (input.charAt(0) == 52) {

//5 enter
if (input.charAt(0) == 53) {

//6 esc
if (input.charAt(0) == 54) {

//7 playpause
if (input.charAt(0) == 55) {

byte cmd[] = {0xFD, 0x03, 0x03, 128, 0x00};
Serial.write(cmd, sizeof(cmd));

//release key
byte cmd2[] = {0xFD, 0x03, 0x03, 0x00, 0x00};
Serial.write(cmd2, sizeof(cmd2));



What control system are you using? If you are working with crestron i’d suggest using the processor to create a press and hold logic. I know this post is old but I just though of a similar idea and after some googling came across your post.