Go to Post When FIRST teams are as numerous and as well supported as basketball teams, we will know that our culture is preparing young people to compete in the 21 st century and we are spending our 2 million minutes wisely. - N7UJJ [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
  #7   Spotlight this post!  
Unread 03-07-2009, 11:09 AM
dboisvert dboisvert is offline
Registered User
AKA: Dan Boisvert
FRC #2405 (Divided by Zero)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Michigan
Posts: 57
dboisvert is an unknown quantity at this point
Re: Joystick Button Press

What I believe I am trying to accomplish is setting it outside of the loop. So basically store a variable and set it to that variable later.

Initial Decleration of flipperset (unsure if that will work)

Code:
Relay::Value flipperset;
sets flipperset to shut the relay off
Code:
		flipperset = Relay::kOff;
If statements to change the flipperset variable
Code:
			if (m_leftStick->GetRawButton(5) == 1 && flipperdoorright->Get() == 0 ) {
				flipperset = Relay::kForward;
			} else if (m_leftStick->GetRawButton(4) == 1 && flipperdoorleft->Get() == 0 ){
				flipperset = Relay::kReverse;
			} else if (flipperdoorleft->Get() == 1 || flipperdoorright->Get() == 1) {
				flipperset = Relay::kOff;
			}
Final set of flipperdoor to a certain variable
Code:
flipperdoor->Set(flipperset);
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
joystick button furiousgeorge Programming 5 02-07-2009 03:57 PM
Intelitek Loader Press PRGM Button Fail ttldomination VEX 1 02-25-2008 07:36 PM
Joystick Hat button ten3brousone Programming 8 02-20-2005 01:31 PM
Joystick Button Deference cibressus53 Electrical 3 11-01-2004 09:38 AM
Can a student Coach press the Stop Button archiver 2001 3 06-24-2002 02:39 AM


All times are GMT -5. The time now is 10:42 AM.

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