|
Re: How to create an On/Off button?
The easiest way would be to save the state as on or off in a boolean or byte variable and then switch it every time the button is pressed.
Pseudo-Code:
Code:
if joystick button pressed then
if lightsAreOn is true then
//so some stuff
set lightsAreOn to false
else
//do some stuff
set lightsAreOn to true
__________________
2012: Buckeye Regional, Queen City Regional, Human Player
2013: Queen City Regional, Buckeye Regional, Crossroads Regional
Shooter Operator
2014: Crossroads Regional, Queen City Regional
Catapult Operator
2015: Georgia Southern Classic Regional (Winner), Queen City Regional
Chainsaw Operator
Want to talk? TeamSpeak: team3266.noip.me
|