Quote:
Originally Posted by Arhowk
Code:
if button.pressed():
if !buttonWasPressed:
buttonWasPressed = True
motorSet = 1 - motorSet
else:
buttonWasPressed = False
motor.set(motorSet)
python pseudocode
|
That doesn't seem like what he is asking for.
I'm not a programmer at all but I think a variable is the correct way to deal with your request.
if Button A is pressed then set variable "X" to 1.
if Button B is pressed then set variable "X" to 2.
if "X" = 1 then Motor runs one way
if "X" = 2 then motor runs the other way
Again. Not a programmer. Just how your request sounds in my head.