I've just tried to add the Compressor class code to my C++ Iterative Robot code and when I load it to the robot it causes a no robot code error. Has anyone else run into this problem and do you have a solution on how you fixed it.
The code I used was:
Code:
public:
/**
* Constructor for this "IterativeRobotDemo" Class.
* Create an instance of a RobotDrive with left and right motors plugged into PWM
* ports 0 and 1 on the first digital module.
*/
IterativeDemo(void) {
cout << "IterativeDemo Constructor Started\n";
// Create a robot using standard right/left robot drive on PWMS 1, 2, 3, and #4
myRobot = new RobotDrive(1, 3, 2, 4);
// Define joysticks being used at USB port #1 and USB port #2 on the Drivers Station
rightStick = new Joystick(2);
leftStick = new Joystick(1);
// Acquire the Driver Station object
ds = DriverStation::GetInstance();
dsLCD = DriverStationLCD::GetInstance();
// Counters to record the number of loops completed in autonomous and teleop modes
auto_periodic_loops = 0;
disabled_periodic_loops = 0;
tele_periodic_loops = 0;
//Compressor Instance
Compressor *cpressor = new Compressor(1,1); //Input DIO Port 1, Relay 1
cpressor->Start(); //Start compressor
I have the compressor Spike wired to Relay 1 and the Pressure Switch wired to Digital Input 1. Would I get a no robot code error if something wasn't physically connected right? The example in the User Guide said to put it in the constructor of the robot and that's the only place I need it, which I have done.
The robot works fine without the compressor code, its just when I uncomments the line above.
Any ideas? Help.