|
Re: PCM output LED not lighting
package org.usfirst.frc.team5736.robot;
import edu.wpi.first.wpilibj.SampleRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.Joystick;
public class Robot extends SampleRobot {
Joystick stick;
DoubleSolenoid gearShift;
public void robotInit() {
stick = new Joystick(0);
gearShift = new DoubleSolenoid(0, 1);
}
public void teleopInit() {
gearShift.set(DoubleSolenoid.Value.kForward);
}
public void teleopPeriodic() {
if (stick.getRawButton(2)) {
gearShift.set(DoubleSolenoid.Value.kForward);
}
else if (stick.getRawButton(3)) {
gearShift.set(DoubleSolenoid.Value.kReverse);
}
Timer.delay(.005);
}
}
|