Hi there.I just built a button box and i was wondering if there is any way to have the buttons for Ignition and headlights mapped for ON/Off buttons instead of momentary push buttons. I would like to turn them off when i put the button in off position, instead of having to put it off and on again to change their state. Thank You!
I'll throw my 2 cents in. If the game had control assignments : Headlights on = ? Headlights off = ? Then yes, but seeing as it only has: Headlights = ? I think no, you can't do it. Now, I was only prepared to throw 2 cents in because I'm actually hoping someone will come in and say I'm wrong, thus I've only lost 2 cents.
Is your button box a "smart" box or just a bunch of switches (JBOS)? If you built it with a microcontroller like an arduino, it would be possible to write the software to do that. I built my button box with an Arduino Teensy, but I only used NO switches and not your standard on-off ones. With an Arduino-based box, you could download different configurations to the box based on whatever car you want to drive tonight.
I do use an arduino to control it. Should i program it to send a button press signal everytime the button changes state?
There's probably code out there already to read and handle an on/off switch. It seems easy...just poll the switch and wait for a change of state. But you have to know which state it started out in when you started the game. The switch could start in the on or off position, so a state change wouldn't tell you much except that it changed state. It might be better to poll it and read if it's high or low and act on that. I don't know how to do that, but I do know a little bit about Google so that's where I'd go.
yes.Ill probably do that.ill set the Ignition default to ON and headlights default to OFF. I can add a function by pressing 2 or 3 buttons at the same time so tha button is deactivated so i can correct the switch in game. Thanks!
Might not a rocker switch fulfill your expectations? A vertically mounted switch could use up for on and down for off. But, they both would have to be active buttons as opposed to a switch that is either on or off. {since off would not activate a command}
I think you're going to need to read what rF2 believes is the state of the switch via a plugin, output status to the controller, and compare to actual state of switch so the controller can update rF2 to the current switch position.