Compressor won't start

i’m using this code and everytihng works on our robot but the compressor won’t start. here is my code any help would be appreciated. thanks in advanced

//***************************************************************************
//2009 Sayville High School Robotics Code
//Uses a 2 motor tank drive system with 2 sim motors wired to jaguars
//has a front roller using a cut in half fisherprice motor wired to a victor
//has a beater bar system power by 1 sim motor wired to a victor
//has a compressor which uses standard compressor class to run during match
//has 2 solenoid that on run together with a pully system used to dump balls
//drive joysticks are standard usb joysticks fron kit of parts
//third joystick is used to control frontroller,beatbars,and both solenoids
//*************************************************************************
//INPUTS
//
//left drive motor(jaguar) - pwm1
//right drive motor(jaguar) - pwm2
//beater bars(victor) - pwm3
//front roller(victor) - pwm4
//Compressor1 - spike relay(relay1),pressure switch (digitalinput1)
//Solenoid 1 -solenoid 1
//Solenoid 2 - solenoid 2
//Left Joystick - USB 1
//Right Joystick - USB 2
//*************************************************************************
//NOTES
//
//victor can only run as slow as 10%
//jaguars can run as slow as 3%
//drive function is (speed,turn)
//setleftmotorrightmotorspeed function is (leftmotor,rightmotor)
//instead of speeds being 0 to 255(binary) speed has been normalized to be -1.0 to 1.0
//************************************************************************

#include “WPILib.h” // include the WPI robotics library

class RobotDemo : public SimpleRobot //class being used is simple robot
//Global Varaibles
{
RobotDrive myRobot; //Robot Drive defines the 2 drive motors
Joystick LeftJoystick; // Defines Leftjoystick
Joystick RightJoystick; // Defines RightJoystick
Joystick ThirdJoystick; // Defines Thirdjoystick
Compressor *Compressor1; // Defines compressor
Solenoid *Solenoid1,*Solenoid2; // Defines Both soleoinds
Victor *FrontRoller, *BeaterBars; // Defines FrontRoller and BeaterBars

public:

RobotDemo(void): // inizalation code
myRobot(1, 2), // drive motors are in pwm 1 and 2
LeftJoystick(1), // leftjoystick in usb port 1
RightJoystick(2), // rightjoystick in usb port 2
ThirdJoystick(3) // thirdjoystick in usb port 3
{
GetWatchdog().SetExpiration(100);
Compressor1 = new Compressor(1, 1); // compressor spike is in realy 1 and pressure switch is in digital input 1
Compressor1->Start(); // compressor will run when not fill during autonomous and operator control mode
Solenoid1 = new Solenoid(1); // solenoid1 is in solenoid module port 1
Solenoid2 = new Solenoid(2); // solenoid2 is in solenoid module port 2
FrontRoller = new Victor(3); // front roller motor in pwm 3
BeaterBars = new Victor(4); // beater bar motor in pwm 4
}

void Autonomous(void) //start of autonomous
{
GetWatchdog().SetEnabled(false); //watchdog is disabled durning autonomous
myRobot.SetLeftRightMotorSpeeds(1.0, 1.0);
Wait(2.0);
myRobot.SetLeftRightMotorSpeeds(-1.0, 1.0);
Wait(2.0);
myRobot.SetLeftRightMotorSpeeds(1.0,0.0);
Wait(2.0);
myRobot.SetLeftRightMotorSpeeds(0.0,0.0);
}

void OperatorControl(void) //start operator control
{
GetWatchdog().SetEnabled(true); // watchdog is enabled during operator control mode
while (IsOperatorControl())
{
GetWatchdog().Feed();
myRobot.TankDrive(LeftJoystick,RightJoystick); //2 Motor Tank Drive
{
{
if (ThirdJoystick.GetRawButton (1)==1 ) //if leftjoystick button 1(trigger) is click
{
Solenoid1->Set(true); // then solenoid1 will be out
Solenoid2->Set(true); // and solenoid2 will be out
}
else // if button 1(trigger) is not pressed
{
Solenoid1->Set(false); // solenoid1 will be in
Solenoid2->Set(false); // and solenoid2 will be in
}
}
{
if (ThirdJoystick.GetRawButton (3)==1 ) {
BeaterBars->Set(0.0); }
else
{
BeaterBars->Set(1.0); }
}
{
if (ThirdJoystick.GetRawButton (5)==1 ) {
FrontRoller->Set(0.0); }
else
{
FrontRoller->Set(1.0); }
}
}
}
}
};

START_ROBOT_CLASS(RobotDemo); // start robot class and starup library(run program)

Try putting a manual switch on Digital Input 1 to rule out a problem with the pressure switch.

You do have the compressor’s Spike connected to the Relay 1 pins on the Digital Sidecar, right? Watch the LEDs for that relay output to see if they are changing as you expect.

We have the spike connected to relay 1 on the sidecard. i’ll take a look at the lights and try using a manual switch. also the compressor works when plugged into a battery.

the led lights on the relay change when u use a switch instead of the pressure switch but the compressor still wont start.

Make sure that the PWM cable for the spike relay is not plugged in 1 pin off on the digital sidecar. If you don’t shave off the little tab on the side of the new PWM cables, it is almost impossible to plug them in right. And even if you do shave it off, it’s an easy mistake. Let’s just say I’m telling you this from experience:rolleyes:

Also, make sure you have the polarity of the power wires going into the compressor spike correct. If the LED on the DSC lights and the compressor doesn’t come on, it’s either a)bad DSC, 2)bad/wrongly installed PWM cable, 3) bad/miswired Spike.

Steve C.

all the lights on the spike don’t turn on. we are having the same promblem with our solenoids too. we wired them to spike like last years.

thanks for all the help. it turns out the relay ports on our digital sidecard didnt work and we had a bad fuse