Thread: Button Command
View Single Post
  #2   Spotlight this post!  
Unread 22-02-2012, 19:40
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: Button Command

Quote:
Originally Posted by Ian McShane View Post
is there a way to end a command when you press a button. EG.
"MoveArmDown" would be a command telling the arm to go down
"End" would be the syntax to end the command
"downSwitch" would be the button

downSwitch.whenPressed(End MoveArmDown)

What would "End" be?
assuming you were using a motor:

buttonA.onPress(new LowerArm())

buttonB.onPress(new StopArm())

LowerArm never actually finishes but rather is interrupted by StopArm


**just make sure they both require the arm subsystem or you may have some explaining to do as to why the arm ate itself.
__________________
"Never let your schooling interfere with your education" -Mark Twain

Last edited by mwtidd : 22-02-2012 at 19:42.
Reply With Quote