Hey!
I seem to have a constant stream of programming problems, but here's my problem.
I can get a relay to work in a basic code (two drive motors, left and right, one joystick plus a single relay.) However whenever I try to move the code over to my FULL bot code (with many motors and two Joysticks) the code just fails.
What I'm using is the following (only parts of it)
Code:
#include <WPILib.h>
class RobotDemo public IterativeRobot
{
Relay *hRelay;
Joystick *stickDrive;
public:
RobotDemo()
{
hRelay = new Relay(1);
stickDrive = new Joystick(1);
}
void TeleopPeriodic()
{
if(stickDrive->GetTrigger())
hRelay->Set(Relay::kForward);
else
hRelay->Set(Relay::kOff);
}
};
START_ROBOT_CLASS(RobotDemo);
This is the parts of the code that included any Relay related stuff. If that runs alone (or almost alone) it works, if that runs in the full program, it doesn't. Any suggestions?
EDIT : Perhaps I should rephrase. What could possibly be in my code to cause this particular part of the code not to work?