Java 类edu.wpi.first.wpilibj.buttons.DigitalIOButton 实例源码

项目:RobotCode2014    文件:ShooterSubsystem.java   
public ShooterSubsystem() {
    winchSafety = new WinchSafetyThread();
    initalizeCANJaguar();
    firedLimit = new DigitalIOButton(RobotMap.SHOOTER_FIRED_LIMIT);
    canLimitBottom = new CANLimitButton(false);
    firedLimit.whenPressed(new LogToBlackBox("CAN Button hit top"));
    canLimitBottom.whenPressed(new LogToBlackBox("CAN Button hit bottom"));
    latch = new Solenoid(RobotMap.SHOOTER_LATCH);
    compressor = new Compressor(RobotMap.COMPRESSOR_SWITCH, RobotMap.COMPRESSOR_RELAY);
    compressor.start();
    SmartDashboard.putNumber("P", P);
    SmartDashboard.putNumber("I", I);
    SmartDashboard.putNumber("D", D);
}
项目:Hyperion3360-2012    文件:Pont.java   
public Pont() {
    mjControl = JoystickDevice.GetCoPilot();
    mjDroite = JoystickDevice.GetTankDriveDroite();
    msBrasDown = new Solenoid(SolenoidDevice.mBrasDown);
    msBrasUp = new Solenoid(SolenoidDevice.mBrasUp);
    msBrasLock = new Solenoid(SolenoidDevice.mBrasLock);
    msBrasUnlock = new Solenoid(SolenoidDevice.mBrasUnlock);
    mdLimitLock = new DigitalIOButton(DigitalDevice.mBrasLimiteLock);

    msBrasLock.set(false);
    msBrasUnlock.set(true);
    msBrasDown.set(false);
    msBrasUp.set(true);
}
项目:Hyperion3360-2012    文件:ReserveBallon.java   
public ReserveBallon() {
    mElevator = new Relay(RelayDevice.mReserveBallon);

    mjGauche = JoystickDevice.GetTankDriveGauche();
    mjControl = JoystickDevice.GetCoPilot();

    limitSwitchBallonHaut = new DigitalIOButton(DigitalDevice.mReserveBallonPresenceHaut);
    limitSwitchBallonBas = new DigitalIOButton(DigitalDevice.mReserveBallonPresenceBas);
    mElevator.setDirection(Relay.Direction.kForward);

    count = 0;
}
项目:HyperionRobot2014    文件:OI.java   
public OI() {
    driverRightJoystick = new Joystick(2);
    driverLeftJoystick = new Joystick(1);

    Button_Canon_SetAngleWhiteZone = new DigitalIOButton(3);
    Button_Canon_SetAngleWhiteZone.whileHeld(new Canon_CoPilotSetAngleZone());
    Button_Canon_SetAngleWhiteZone.whenReleased(new Canon_CancelPrepareTopGoal());
    Button_Canon_SetAngleWhiteZone.whenReleased(new CanonAngle_HandleManualMode());

    Button_DriverCanon_PrepareTopGoal = new JoystickButton(driverLeftJoystick, 1);
    Button_DriverCanon_PrepareTopGoal.whileHeld(new CanonSpinner_PrepareTopGoal());
    Button_DriverCanon_PrepareTopGoal.whenReleased(new Canon_CancelPrepareTopGoal());

    Button_DriverCanon_Shoot = new JoystickButton(driverLeftJoystick, 7);
    Button_DriverCanon_Shoot.whenPressed(new CanonShooter_Shoot());

    Button_Canon_PilotShootAuto = new JoystickButton(driverRightJoystick, 1);
    Button_Canon_PilotShootAuto.whileHeld(new Canon_ShootTopGoalTeleop());
    Button_Canon_PilotShootAuto.whenInactive(new CanonAngle_HandleManualMode());

    Button_DriveTrain_MoveTo = new JoystickButton(driverRightJoystick, 9);
    Button_DriveTrain_MoveTo.whenPressed(new DriveTrain_MoveTo(2));

    Button_Canon_CopilotGrab = new JoystickButton(driverLeftJoystick, 2);
    Button_Canon_CopilotGrab.whileHeld(new Canon_CopilotGrab());
    Button_Canon_CopilotGrab.whenInactive(new CanonAngle_HandleManualMode());

    Button_CanonShooter_Shoot = new DigitalIOButton(1);
    Button_CanonShooter_Shoot.whenPressed(new CanonShooter_Shoot());

    Button_CanonSpinner_ShootSpeed = new DigitalIOButton(2);
    Button_CanonSpinner_ShootSpeed.whileHeld(new CanonSpinner_PrepareTopGoal());

    Button_CanonSpinner_CatchSpeed = new DigitalIOButton(4);
    Button_CanonSpinner_CatchSpeed.whileHeld(new CanonSpinner_ReceivePass());

    Button_CanonSpinner_SetManualMode = new DigitalIOButton(8);
    Button_CanonSpinner_SetManualMode.whenInactive(new CanonSpinner_HandlePresetMode());
    Button_CanonSpinner_SetManualMode.whileHeld(new CanonSpinner_HandleManualMode());

    Button_ResetShooterMIN = new JoystickButton(driverRightJoystick, 6);
    Button_ResetShooterMIN.whileHeld(new CanonAngle_SetShooterAngle(8));
    Button_ResetShooterMIN.whenReleased(new CanonAngle_Cancel());

    Button_ResetShooterMAX = new JoystickButton(driverRightJoystick, 11);
    Button_ResetShooterMAX.whileHeld(new CanonAngle_SetShooterAngle(90));
    Button_ResetShooterMAX.whenReleased(new CanonAngle_Cancel());

}