View Single Post
  #5   Spotlight this post!  
Unread 08-02-2015, 16:53
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: Help with toggle-button

i have this code so far, i cant get it to work, any idea of what could be wrong?



Code:
#include "WPILib.h"

class Robot: public SampleRobot
{
	bool Piston;
	Joystick stick; // joystick

	Piston = false; 
	Talon m_motor1;
	Talon m_motor2;
public:
	Robot() :
		m_motor1(1),	
		stick(0)
}

{
		myRobot.SetExpiration(0.1);
	
}
	if(Piston){
		m_motor1.Set(Stick.GetY()); // Where as the talon1 would be controlled by the Y axis of the Joystick
	} else if (!Piston){
		m_motor2.Set(Stick.GetY());// Where as another talon, talon2, would be controlled by the Y axis of the Joystick
	}





};

START_ROBOT_CLASS(Robot);
Reply With Quote