View Single Post
  #1   Spotlight this post!  
Unread 23-03-2013, 13:00
cisasteelersfan cisasteelersfan is offline
Registered User
FRC #0222
 
Join Date: Nov 2012
Location: Tunkhannock
Posts: 1
cisasteelersfan is an unknown quantity at this point
Run a series of instructions when button is pressed

Hi all,
I'm trying to figure out how to 'automate' our shooting process. Currently in teleop we simply have a button wired to a solenoid: true means forward, and reverse means back.

When a button is held down, we want the solenoid to go forward and back four times in a certain amount of time.

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).

It doesn't work as programmed. Does anybody have any ideas? I considered putting an autonomous-style loop in teleop, but is that the optimal solution?

Any suggestions are greatly appreciated!
Reply With Quote