|
Re: No compressor light on PCM, no compressor power, no CAN recognition of compressor
Make sure you have at least one Solenoid or DoubleSolenoid decleared in your code. The compressor will not be initialized without having at least one:
Code:
Solenoid name = new Solenoid(1);
This code should actuate the double solenoid based on joystick button:
Code:
package org.usfirst.frcEasyJ.team5122;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.DoubleSolenoid;
public class MyRobot extends IterativeRobot {
Joystick JS1 = new Joystick(1);
DoubleSolenoid DValve1 = new DoubleSolenoid(1, 2);
public void autonomousInit() {
}
public void autonomousPeriodic() {
}
public void teleoperatedPeriodic() {
if (JS1.getRawButton(1)) {
DValve1.set(DoubleSolenoid.Value.kForward);
} else {
DValve1.set(DoubleSolenoid.Value.kReverse);
}
}
public void teleoperatedInit() {
}
}
__________________
Blake
Electrical, Programming and Design
Creator FRC Q&A 2017
Mass FRC Team 4909: The Bionics
Maine FRC Team 5122: The RobOTies (2014-2015)
Maine FRC Team 2648: Infinite Loop (2008-2011)
|