Pneumatic Compressor not starting up Pneumatic Compressor not starting up

This is the third day I have been at this (working on pneumatics).

Now the compressor is attached to a spike, then the spike is connected to the power distribution board both 20amp breakers. The spike is connected to the digital sidecar in relay slot 1 (sig [a], pow**, ground-]). And the pressure switch is connected to Digital I/O 1 (Black on Nc, Red on C).


package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Watchdog;

public class RobotTemplate extends SimpleRobot {

    private static final long TIME_DELAY = 1000; //in milliseconds
    Joystick leftStick = new Joystick(1);
    Joystick rightStick = new Joystick(2);
    Joystick three = new Joystick(3);
    Jaguar rightF = new Jaguar(2);
    Jaguar rightB = new Jaguar(1);
    Jaguar leftF = new Jaguar(3);
    public Jaguar leftB = new Jaguar(4);
    public Compressor fluffy = new Compressor(1, 1, 1, 1);
    DriverStation ds;
    Watchdog fenrir = Watchdog.getInstance();

  

    void drive() {
        if (leftStick.getRawButton(1)) {
            leftF.set(-1.0);
            rightB.set(1.0);
            leftB.set(1.0);
            rightF.set(-1.0);
        } else {
            if (rightStick.getRawButton(1)) {
                leftF.set(1.0);
                rightB.set(-1.0);
                leftB.set(-1.0);
                rightF.set(1.0);
            } else {
                leftF.set(leftStick.getY());
                rightB.set(rightStick.getY() * -1);
                leftB.set(leftStick.getY());
                rightF.set(rightStick.getY() * -1);

            }
        }

    }

    void com() {
        fenrir.feed();
        if (fluffy.getPressureSwitchValue()) {
            fluffy.setRelayValue(Relay.Value.kOff);
        } else {
            fluffy.setRelayValue(Relay.Value.kOn);

        }
    }

    public void autonomous() {
        fenrir.feed();
    }

    public void operatorControl() {
        while (true && isOperatorControl() && isEnabled()) {
            fenrir.feed();
            com();
            drive();
        }
    }
}

Here is he code I went over a ton of times and can’t see anything wrong with it. Help please.

I know its also in the pneumatic’s thread but more people are viewing this thread.**

Is the fuse in the spike still good? Note that a spike used to control the compressor is allowed to have a special self-resetting 20A fuse. I cannot comment on your code.

Ya it is I have tried 3 different spikes with different 20A fuses.

We had a problem like this, try another digital output port on the digital sidecar and change it in the code

also why are some of your vars declared public and some are not?

Ok I declared all the var public. I have tried switching the PWM and in my code and it will not work.

hmm the code looks correct you could try removing the watch dog in the com method

can you drive the robot fine?

Which Spike relays are you using? Are you using the new VexPro relays from this years KoP or the older IFI relays. For whatever reason, the old relays no longer work with WPILib functions this season. We just struggled with this problem for hours and found that the solution was using the VexPro Spike relay from this year’s KoP.

Well we figured it out the ribbon cable was first backwards and then did not get a full crimp on it when we re did it so now we are going to use last years and now everything works thank you every one for your help. :stuck_out_tongue: :o :]