Hello, I've been struggling to figure this out for a long time.
I'm pretty new to this and desperate for your help!
I want to make a wireless macro keyboard using buttons, arduino pro micro, and an HC-05 bluetooth module which is upgraded to have HID Firmware. Basically, The goal is simple. Once a button is being pressed down a keystroke will be sent from the arduino to the computer (using an HC-05 HID compatible module), thus performing a key press just like a bluetooth keyboared does.
Well, as I understand I can't use the keyboared.h library for this purpose since it was made for a USB cable connection and not bluetooth.
What I cannot manage to understand are 2 things:
- Should I connect the HC-05 by the Hardware Serial (Tx Rx) ports or rather by SoftwareSerial pins?
- How to send the keystrokes in terms of code ?
There's the serial.write function, but why even using it in the firstplace?
I mean how does the keystrokes are being performed in the computer by just passing them through the serial terminal? I'm pretty sure HC-05 uses serial bluetooth communication and that there's a certain structure for the data of the keys being passed called "HID Report". However, I still can not understand how to get it all together.
The only tutorials I found on this are these two, one uses a really long code and the other uses a much simpler code, but also uses an adafruit BLUEFRUIT instead of the HC-05. How adafruit managed to come up with such a more simple code?
Adafruit method - look at the code shown here, line 147, keyCommand function - it was all done in 11 rows of code.
HC-05 HID method - code at the end, much longer one, and the only way I found for transferring the keystrokes data with HC-05.
Thank you in advance!!!