|
Re: Run a series of instructions when button is pressed
We have a similar setup. In Teleop, we set a global variable whenever the shoot button is pressed, and then in Periodic Tasks, we have a flat sequence structure for timing the solenoid's activation. This structure is inside one of Periodic Task's while loops, so it runs continuously while the button is being held down. I've attached our code so you can take a look.
__________________
Boo! Bishop Grandin High School / GM Canada / Tenaris
2013 Western Canada - Quarterfinalists (thanks 288/4719) / 2012 GTR West - Quarterfinalists (thanks 188/1075) / 2011 GTR East - Regional Winners (thanks 1114/1503)
|