Go to Post Parallax is evil. - RoboChair [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
  #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
 


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
Controlling the camera with a joystick Dakabt Programming 9 01-02-2010 21:51
Joystick Button Issues pyr0b0y NI LabVIEW 6 21-04-2009 09:29
joystick button furiousgeorge Programming 5 07-02-2009 15:57
How do I program a relay to turn on and off by pressing a button on the joystick? eweathers NI LabVIEW 4 28-01-2009 22:34
Speed controlling a relay..?!?!?one/???? Monochron Programming 13 17-02-2007 21:43


All times are GMT -5. The time now is 13:49.

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