|
Re: Toggling Between Two buttons
Code:
if button.pressed():
if !buttonWasPressed:
buttonWasPressed = True
motorSet = 1 - motorSet
else:
buttonWasPressed = False
motor.set(motorSet)
python pseudocode
__________________
FRC Team 1684 - Head Programmer (2013-2016)
FRC Team 5460 - Programming Mentor (2015-2016)

FIRST in Michigan - Technical Crew (2015-continuing)
|