Hi! We have spent many hours trying to get our Double Solenoid to work but all attempts have ultimately failed. We get green lights on the card in the CRIO slot showing us that it does have signal. The Solenoid is yellow on both sides and is 12V which is the voltage we are giving it. There is no clicking or any evidence the solenoid is bad or can't fire. We tried many other solenoids without luck. Any help will be greatly appreciated! Code:
Code:
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.buttons.Button;
import edu.wpi.first.wpilibj.buttons.JoystickButton;
public class RobotTemplate extends SimpleRobot {
private final Joystick DriverStick,other; //defines Axis Camera
private final DoubleSolenoid s1;
RobotDrive myDrive;//defines solenoids
private boolean orange;
public RobotTemplate() {
myDrive = new RobotDrive(3,2);
DriverStick = new Joystick(1);
Compressor airCompressor;
airCompressor = new Compressor(14,7);
airCompressor.start();
other = new Joystick(2);
s1 = new DoubleSolenoid(3,8);
}
public void operatorControl() {
while (isOperatorControl() && isEnabled()){
myDrive.tankDrive(other, DriverStick);
if(DriverStick.getRawButton(1) == true)
{
s1.set(DoubleSolenoid.Value.kReverse);
}
if(DriverStick.getRawButton(2) == true)
{
s1.set(DoubleSolenoid.Value.kForward);
}
}
}
}
}