View Single Post
  #5   Spotlight this post!  
Unread 31-03-2013, 16:08
lorem3k's Avatar
lorem3k lorem3k is offline
1 + 1 = 0 (in Z/2Z)
AKA: Andy D.
FRC #1482 (Bishop Grandin Ghosts)
Team Role: Alumni
 
Join Date: Apr 2012
Rookie Year: 2011
Location: Calgary, AB
Posts: 165
lorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to behold
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.
Attached Files
File Type: vi Shoot2.vi (24.2 KB, 16 views)
File Type: vi Solenoid Cycle.vi (34.4 KB, 11 views)
__________________
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)
Reply With Quote