View Single Post
  #2   Spotlight this post!  
Unread 20-02-2010, 21:11
whatabouteve whatabouteve is offline
Registered User
AKA: Dean Keithly
FRC #0245 (Adambots)
Team Role: Leadership
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Rochester Hills,MI
Posts: 45
whatabouteve is an unknown quantity at this point
Re: Limit switch not working properly.

class RobotDemo : public SimpleRobot
{
DigitalInput *switch1;
}

public:
RobotDemo(void):
{
switch1 = new DigitalInput(4,2);//4 is the modual in cRio and 2 the input port
}


that is initializing it but you need to do the rest. you will get a 1 or 0 and need to declare a bool variable to take the number from it in the form

variable = switch1->Get();
or
use switch1->Get() in your conditional


hope it helps
Reply With Quote