Hi everyone, I am attempting to make a digital E-Brake for my racing sim setup. I have a Arduino Uno with a bread board. All I am trying to do is map the 4 pin button to a keyboard letter such as P. I know that there are previous discussions about this matter however The links no longer work. Thank you so much!
Sorry thought I could be a little more clear, just needed some help on the software side
please read
The Uno does not support the Keyboard library that you need to do what you are asking about. The Keyboard library documentation tells you which processors are supported.
Does your racing sim setup support serial input? Or does it require a HID (like a normal keyboard)?
If the latter, the Uno is the wrong board; boards with native USB would be the choice (Leonardo, Micro, Pro Micro and plenty of others). You can hack Unos with 16U2 TTL-to-USB chip to provide HID functionality; I've never had a need to use it so can't advice further.
Code wise it could look something like below (for serial; not tested); note that this is the bare basics.
if(digitalRead(buttonA))
{
Serial.write('A');
}
if(digitalRead(buttonB))
{
Serial.write('B');
}
Exact implementation depends on how your buttons are wired.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.