I have successfully programmed an Arduino Uno to act as a keyboard. When coupled with a Titan 2, I can then use it for PS4 adaptive controls.
The function I used to send the 'keystrokes' for the Arduino Uno was Serial.write(buf, 8 ), where buf was a unit8_t consisting of the ASCII codes for the given buttons pressed ( 0 or null if not pressed).
Now that I would like to do the same task with the Leonardo (cost savings and ease of board configuration) I have tried using Keyboard.write, Keyboard.press and Keyboard.release, which do not accept unit8_t inputs. I have tried multiple different arrangements of the three functions. I have ended up with individual lines of code, for example:
Keyboard.write with a delay acts exactly as a keyboard, however cause serious glitching on the Titan 2 (gaming controls very unresponsive).
Keyboard.Press and Keyboard.releaseall (as above), type multiple characters for one press, but drastically reduced the glitchiness on the Titan 2. Which is good but not perfect.
I have a hunch that reducing the amount of data being sent to the Titan 2, by finding the correct format to use Keyboard.write in one line of code, would do the trick.
When using the Uno, what i in the 8 byte buffer? For example, to send lowercase 'a' does the buffer contain in hex "00 00 04 00 00 00 00 00"? If yes, this is a standard USB keyboard HID report using USB key codes, not ASCII.
It is possible to send USB keyboard HID reports on Leonardo and Micro. This helps when the ASCII to USB key code translation does not do what you want.
How did you end up going with your Arduino Leonardo Keyboard for PS4 ? I was trying to do this project a few weeks already and unfortunately, no luck. Would you mind to share your UNO programming and wiring as well ?
Cheers,
Mid
RBernier:
Hello,
I have successfully programmed an Arduino Uno to act as a keyboard. When coupled with a Titan 2, I can then use it for PS4 adaptive controls.
The function I used to send the 'keystrokes' for the Arduino Uno was Serial.write(buf, 8 ), where buf was a unit8_t consisting of the ASCII codes for the given buttons pressed ( 0 or null if not pressed).
Now that I would like to do the same task with the Leonardo (cost savings and ease of board configuration) I have tried using Keyboard.write, Keyboard.press and Keyboard.release, which do not accept unit8_t inputs. I have tried multiple different arrangements of the three functions. I have ended up with individual lines of code, for example:
Keyboard.write with a delay acts exactly as a keyboard, however cause serious glitching on the Titan 2 (gaming controls very unresponsive).
Keyboard.Press and Keyboard.releaseall (as above), type multiple characters for one press, but drastically reduced the glitchiness on the Titan 2. Which is good but not perfect.
I have a hunch that reducing the amount of data being sent to the Titan 2, by finding the correct format to use Keyboard.write in one line of code, would do the trick.