Bluetooth Arduino + RN-42 HID Module

I am trying to create a “keyboard” using the Arduino Mini Pro and the RN-42 HID Bluetooth . I can connect to it using a MacBook , and it appears as a Bluetooth keyboard. In addition, I can press buttons and send commands.

Perfectly?

Unfortunately, no ... I do not know how to encode the bytes that I need to send to the module in order to inform it of keystrokes and key releases. I read all the Bluetooth RN-42 instructions that I can get, but I do not quite understand what I should send to the Bluetooth module. I searched Google Search for several weeks, and I cannot find the C code that would help me. As far as I know, USB keys are sent as hex arrays. It is right? If so, how would this be done?

+5
source share
4 answers

arduino silverball, RN42 HID- . , , HID BT. Mine .

, BT- HID ( S~,6 GPIO11 high ). HID factory, SH,0200 BT, .

RAW- BT, :

RN42 HID :

|start(1 byte)|length(1 byte)|descriptor(1 byte)|data(length - 1 [for the descriptor]) 

:

|0xFD|9|1|modifier|0x00|code 1|code 2|code 3|code 4|code 5|code 6 

( )

bit 7  |bit 6  |bit 5    |bit 4  |bit 3  |bit 2  |bit 1    |bit 0 
rt GUI |rt alt |rt shift |rt ctrl|lt GUI |lt alt |lt shift |lt ctrl

github - , !

+6

, RN-42 HID-611:

, , ASCII @115200 RN-42, . , Serial1.println("Hello");, Hello(enter) Mac. , , RN-42 SPP, GPIO11 RN-42 HID-.

+1

, RN-42 HID-611:

, , ASCII @115200 RN-42, .

, RN-42 HID, , sparkfun .

0

If you want Arduino to send messages from the keyboard to the computer, use Keyboard.press () to press keys and Keyboard.release () to release. I don't have this type of Arduino or this Bluetooth module, but since it recognizes the Arduino as a keyboard, I think this should work ...

-2
source

All Articles