Quote:
Originally Posted by cisasteelersfan
What I've tried is putting a global variable that is true when the button is pressed. This gets passed to periodic tasks where if true, it runs a for loop four times. This outputs to another global variable that is passed to teleop that controls the solenoid (forward or reverse).
|
That seems kind of the long way around to do it. Why not just do everything in Periodic Tasks? Read the controller button and use it to either do nothing or run the For loop. Set the solenoid right there inside the For. Put the whole thing inside a While loop that has a 20 ms delay.