View Single Post
  #1   Spotlight this post!  
Unread 18-06-2015, 14:36
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 222
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Can't get Solenoid to fire?

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);
            }
           
         }
    }
    }
    

}