View Single Post
  #1   Spotlight this post!  
Unread 15-02-2015, 18:27
PredaFran PredaFran is offline
Amateur Programmer
AKA: Francisco
FRC #5285 (Sea Kings Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: California
Posts: 25
PredaFran is an unknown quantity at this point
Re: Limit switch help

can you give me a hand with the bool?

Code:
#include "WPILib.h"


class Robot: public SampleRobot
{
	Talon Motor;
    DigitalInput limitSwitch;
    bool limitValue

public:
	 Robot():

	limitSwitch(1),
	Motor(6)

	{

	}

	 

	void OperatorControl()
	{
		while (IsOperatorControl() && IsEnabled())
		{
         	if(limitSwitch.Get()=1)
            {
			Motor.Set(1.0);
         	Wait(0.005);
            }
     


		}

	}

};

START_ROBOT_CLASS(Robot);
Reply With Quote