@sgeg I followed your instructions from the top of this thread and upon compiling I am getting this error:
#error The Joystick library can only be used with a USB MCU (e.g. Arduino Leonardo, Arduino Micro, etc.).
exit status 1
Error compiling for board Arduino/Genuino Uno.
For what it's worth I'm working with a Leonardo. Single toggle switch on pin 5.
hi @rvaupel23
you're problem looks more about compiling issue, if you use more than one Arduino be sure that you select the right Serial port and board when you are compiling your Leonardo with Simhub Sketch setup.
if you are not sure unplug all other arduino connected.
https://github.com/SHWotever/SimHub/wiki/Arduino--Setup
FYI: don't select your button in the sketch setup to avoid error
@sgeg I was actually able to solve this a different (and easy) way for iRacing using basic SimHub functionality.
- I'm using a single Arduino Leonardo with a basic toggle switch configured using the SimHub hardware configurator / setup tool for Arduino (as a button)
- In iRacing, under Controls, I mapped the key "I" to ignition
- In SimHub, navigated to Controls and Events.
- Hit add mapping
- Used short press for "on" and simulate the key ("I") as referenced in the game
- Used released for "off" and simulate the key ("I") again as referenced in the game
Works perfectly for me.