View Single Post
  #7   Spotlight this post!  
Unread 07-03-2009, 11:09
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