Go to Post Why does school have to get in the way of more important things like FIRST? When would we ever need to know about the stuff there teaching in here? - Briansmithtown [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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: 495
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
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 14:04.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi