Is it possible to use the joystick library to get toggle switches to act like momentary switches? I'm trying to make a button box for the game OMSI 2, but it only supports "momentary switches", so if I want to use a toggle switch, I will have to write a code that works like this:
When the switch is toggled on, it will send a 0.5-second pulse to the system, then the switch is "released". After when the switch is toggled off, it will send another 0.5-second pulse to the system to the same button map again.
I'm not quite sure how to write the part that the Arduino sends a 0.5-second pulse to the system, then the switch is "released", it would be great if there is some kind of example that I could refer to. I hope I'm being clear here, any questions please ask!