View Single Post
  #1   Spotlight this post!  
Unread 24-04-2010, 12:35
DWirth DWirth is offline
Registered User
FRC #2509
 
Join Date: Feb 2009
Location: Hutch
Posts: 10
DWirth is an unknown quantity at this point
Joystick Button Controlling Relay

Hello,
I'm having problems with the code I have written. Every time I compile the .cpp file it tells me:
'If' undeclared (first use of the function)
'Else' undeclared (first use of the function)
I think this means that the if and else statement do not know what they are controlling. Please correct me if I'm wrong. This is my code below:

Code:
{
				If(stick->GetRawButton(1));
					relay1->Set(Relay::kForward); // run line when button is pressed
				Else;
					relay1->Set(Relay::kOff); // or run this line when button isn't pressed
			}
Reply With Quote