I get the FD, the 5 bytes is for Length not sure so should it be 0x05? And then the rest I take it would be a hex value for each? I am not sure what the value would be for Buttons X, Y and Wheel
There is an example of a keyboard press and that is
0xFD 0x03 0x03 0x00 0x10 for keydown
0xFD 0x03 0x03 0x00 0x00 for keyup
In case anyone finds this and wants to know the solution.
I was using binary instead of the hex value. The manual needs to be more clear. So for mouse mode I used 0020 and it worked Other stuff to figure out still, like what the range is for the cursor movement and how to map that to a absolute position.
like what the range is for the cursor movement and how to map that to a absolute position.
The range is, in theory, unbounded. Of course, the actual position is stored in a variable of some type that imposes limits. The absolute position must be determined by adding all the + movements and subtracting all the - movements.
Hello, I was wondering if you could tell me how you send the hid reports to the bluesmirf. I have been trying to send the report through the uart connection from a terminal window. Instead of the module interpreting the report it justs sends each character as a key press.
I have sent 0xFD 0x9 0x1 0x0 0x04 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 to the module which the manual says will send an event that the "a" key has been pressed.
Thanks, that worked nicely. I've got my arduino sending events to it now as well.
My only problem with it now is that it does not send back any feedback after sending it any commands. It goes into command mode with $$$ but it doesn't send back the CMD response. I changed the name of the module with the SN command but it does not send back AOK even though the name was successfully changed.
Anyway, at least I know how to send events to it now.
Should be nothing sent after $$$ but all other commands expect a new line. At least thats what it looks like since the commands are executed I just don't get any feedback.
I've sent mouse x and y values from my arduino with byte( val );
I tested it out with this:
Your right, x and y seem to be relative distances. I think I was just moving it so far that it wrapped around maybe?
I don't see any way to set an absolute position. I have it in mouse mode for now.
I am working on a way to translate absolute to relative. The mouse when connected to my phone starts in the middle so just have to track from there. I am testing using processing and just jumping to where I click the mouse. So far its not working so well. I think you can only move so far per command. So I tired to move in smaller jumps to the click location but still not working right.
I think mine is in combo mode. On my phone it won't wrap but I didn't try on a computer.
Haven't had a chance to get back to this project, really need to get this working so I can work on the touchscreen part.
You can only make small jumps since we only have a byte to store the position. Also my code "byte( random( 1366 ) )" doesn't make any sense since the maximum value would be 256, and since its signed the range is -127 to 127. And that would be why you can only move small distances at a time.
esgeroth:
Have you gotten your module to auto connect after a power cycle?
HI guys!
For autoconnect you need to put the device in pair mode. You can get that mode by sending the command "SM,6" on the uart. In this mode the module will pair up with the last device. Works well for me.
Now when i try to see this on the serial window, I get
aaaaaa
bbbbbbbbb
ccc
aaaaaaaaa
bb
cccccccc
and so on..
A lot of characters are lost
When i do this with a SPP module by bluesmirf, I get all the characters.
Any idea why this might be happening?
You are sending serial data out as fast as possible at that baud rate. Perhaps you need to consider that the other end can't keep up. Some reasonable delay after spamming the serial port may be necessary to allow the other end to keep up.
Hi, how did you get the HID module into mouse mode? I'm struggling to figure out how to connect it to my PC and get it into command mode. Can you post simple instructions?
Hello,
Hope you will answer guys.
I'm trying to use the RN-42 to control an Android tablette Nexus 7. I am using Tera Term terminal. I put the device in HID mode and I configured the RN42 to the Combo type. I connected my self to the Nexus 7 but i don't know how to send commands in Hexadecimal. I know that we have to send "0xfd 0x3 0x3 0x80 0x00" for example to play or pause a track but i don't know how to send it in Hex.
Thank you for your help
wgarrido:
In case anyone finds this and wants to know the solution.
I was using binary instead of the hex value. The manual needs to be more clear. So for mouse mode I used 0020 and it worked Other stuff to figure out still, like what the range is for the cursor movement and how to map that to a absolute position.
Hello, I know this is an old post but I wanted to ask you how you sent the commands to change the RN-42 between keyboard and mouse modes. I have a RN-42 set as a keyboard. I used a terminal to send the commands to set it as so (it used a COM port). Now that the device is in HID, this method doens't seem to work