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);