View Single Post
  #4   Spotlight this post!  
Unread 08-02-2015, 01:26
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 494
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Help with toggle-button

All you would have to change is this part of the code assuming you keep Booleons named the same:

Code:
if(Piston){
	piston.Set(Relay::kForward);
} else if (!Piston){
	piston.Set(Relay::kReverse);
}
To something like this:

Code:
if(Piston){
	Talon1.Set(Stick.GetY()); // Where as the talon1 would be controlled by the Y axis of the Joystick
} else if (!Piston){
	Talon2.Set(Stick.GetY());// Where as another talon, talon2, would be controlled by the Y axis of the Joystick
}
Reply With Quote