コード例 #1
0
ファイル: OI.java プロジェクト: ThunderboltsRobotics/FRC2016
  public OI() {
    runShooterButton = new JoystickButton(primaryJoystick, JoyConfig.joy0.buttonShooterForward);

    buttonThatTotallyDoesStuff =
        new JoystickButton(secondaryJoystick, JoyConfig.joy1.buttonThatTotallyDoesStuff);

    runShooterButton.whenPressed(new RunShooter());
    //		myTestTrigger.whileActive(new SetDrivePower());
  }
コード例 #2
0
ファイル: OI.java プロジェクト: jz5003/disco-frc
 private void mapButtons() {
   // Drive Commands (Analog Sticks are reserved for the drivetrain)
   b_sStar.whenPressed(new CycleDriveCommand());
   // Shoot Commands
   b_btnX.whenPressed(new CycleShootCommand());
   b_trigR.whenPressed(new ShootMain());
   b_dpadR.whenPressed(new PWMSetpointIncrement(0.05));
   b_dpadL.whenPressed(new PWMSetpointIncrement(-0.05));
   // Compressor Commands
   b_btnB.whenPressed(new CompressorToggle());
   // Collector Commands
   b_dpadU.whenPressed(new ArmUp());
   b_dpadD.whenPressed(new ArmDown());
   b_btnY.whenPressed(new ArmToggle());
 }
コード例 #3
0
  public OI() {
    // Joysticks
    driver = new Joystick(RobotMap.DRIVER);
    codriver = new Joystick(RobotMap.CODRIVER);

    // Buttons
    sweepIn = new JoystickButton(driver, RobotMap.SWEEP_IN);
    prime = new JoystickButton(driver, RobotMap.PRIME);
    fire = new JoystickButton(driver, RobotMap.FIRE);
    up = new JoystickButton(driver, RobotMap.UP);
    down = new JoystickButton(driver, RobotMap.DOWN);
    blind = new JoystickButton(driver, RobotMap.BLIND);

    // Buttons and Commands
    sweepIn.toggleWhenPressed(new Spin(false)); // While held the launch wheels will spin inwards
    prime.toggleWhenPressed(new Spin(true)); // While held the launch wheels will spin outwards
    fire.whenPressed(new Fire()); // If pressed while prime is also pressed, will fire the ball
    up.whenPressed(new Lift(true));
    up.whenReleased(new HoldArm());
    down.whenPressed(new Lift(false));
    down.whenReleased(new HoldArm());
    blind.toggleWhenPressed(new BlindThemAll());
  }
コード例 #4
0
ファイル: OI.java プロジェクト: jakestauffer/Sentinel-2.0
  private void initDriver() {
    buttonA = new JoystickButton(driver, 1);
    buttonStart = new JoystickButton(driver, 8);
    buttonLB = new JoystickButton(driver, 5);
    buttonY = new JoystickButton(driver, 4);
    buttonRB = new JoystickButton(driver, 6);
    buttonB = new JoystickButton(driver, 2);
    buttonX = new JoystickButton(driver, 3);
    buttonRST = new JoystickButton(driver, 9);
    buttonLST = new JoystickButton(driver, 10);
    buttonBack = new JoystickButton(driver, 7);

    buttonA.whenPressed(new ElevatorArmsSolenoidCommand());
    buttonStart.whenPressed(new ElevatorBrakeSolenoidCommand());
    buttonLB.whenPressed(new TopArmsSolenoidCommand());
    buttonY.whenPressed(new CollectorArmsSolenoidCommand());
    buttonRB.whenPressed(new CollectorMotorsCommand(0.5));
    buttonRB.whenReleased(new CollectorMotorsCommand(0));

    // hello

  }
コード例 #5
0
ファイル: OI.java プロジェクト: Team2168/FRC2012
  public OI() {
    // drive left axis = left drivetrain in DriveWithJoystick
    // drive right axis = right drivetrain in DriveWithJoystick

    driveButtonRightBumper.whenPressed(new ShiftGearsLowToHigh());
    driveButtonLeftBumper.whenPressed(new ShiftGearsHighToLow());
    driveButtonStart.whenPressed(new LowerBridge());
    driveButtonStart.whenReleased(new RaiseBridge());
    driveButtonReset.whenPressed(new PegLegDown());
    driveButtonReset.whenReleased(new PegLegUp());

    // aux left axis = left DriveElevatorJoystick
    // aux right axis = right ShooterWheelJoystick
    auxButtonA.whenPressed(new key2_3());
    auxButtonB.whenPressed(new side2_3());
    auxButtonY.whenPressed(new fender2_3());
    auxButtonX.whenPressed(new PID_ShooterPause());

    auxButtonStart.whenPressed(new shootSingleBall());

    auxButtonRightBumper.whenPressed(new BackFlapClose());
    auxButtonLeftBumper.whenPressed(new BackFlapOpen());

    /*
     * Note, All buttons on button box are pulled up. They see +V when they are not pressed.
     * In the case of the switches. Down corresponds to the off state (switch open), +V seen at input module.
     *
     * I'm pretty sure the DigitalIOButton class expects the buttons to be pulled up. So a button "pressed" condition is
     * true when the IO module sees a short to ground. So "pressed" in the software should correlate to "pressing down on
     * the button. (for switches, pressing is equivalent to moving it to the "up" position.
     *
     */
    //		ioDigital1.whenPressed(); //Manual/Automatic mode select	auto up manual down
    //	//WIRED - JMC
    ioDigital2.whileHeld(
        new DriveElevatorConst(RobotMap.liftVoltage)); // raise lift					//WIRED - JMC
    ioDigital3.whileHeld(
        new DriveElevatorConst(-RobotMap.liftVoltage)); // lower lift					//WIRED - JMC
    ioDigital4.whenPressed(new BackFlapOpen()); // Hopper Down											//WIRED - JMC
    ioDigital5.whenPressed(new BackFlapClose()); // Hopper Up											//WIRED - JMC
    ioDigital6.whenPressed(
        new fender2_3()); // front goal shot. high/low determined by switch10	//WIRED - JMC
    ioDigital7.whenPressed(new side2_3()); // side goal shot									//WIRED - JMC
    ioDigital8.whenPressed(new key2_3()); // key shot											//WIRED - JMC
    // ioDigital9.whenPressed(new camera2_3()); //camera shot										//WIRED - JMC
    // ioDigital10.whenPressed(); //Shooting mode switch	(2pt/3pt)										//WIRED - JMC
    ioDigital11.whenPressed(
        new PID_ShooterPause()); // set shooter to zero/turn off shooter			//WIRED - JMC
    ioDigital12.whenPressed(new shootSingleBall()); // fire												//WIRED - JMC
    ioDigital13.whenPressed(new RaiseHood()); // Switch13 position to raise hood					
    ioDigital13.whenReleased(new LowerHood()); // Switch13 position to lower hood
    //		ioDigital14.whenPressed();  //Autonomous Mode - counter "1"											//WIRED - JMC
    //		ioDigital15.whenPressed();  //Autonomous Mode - counter "2"											//WIRED - JMC
    //		ioDigital16.whenPressed();  //Autonomous Mode - counter "4"											//WIRED - JMC
    // Autonomous Mode - counter "8" is not wired							//WIRED - JMC

    // wheelPots.whileHeld(new ShooterWheelWithPot());

    // ioModule Analog1 - Voltage reference, VCC
    // ioModule Analog2 - Manual Shooter Speed, fine control (top slide pot)
    // ioModule Analog3 - Manual Shooter Speed, coarse control (bottom slide pot)
    // ioModule Analog4
    // ioModule Analog5
    // ioModule Analog6
    // ioModule Analog7 - Right Delay Potentiometer
    // ioModule Analog8 - Left Delay Potentiometer
  }
コード例 #6
0
 // Called repeatedly when this Command is scheduled to run
 protected void execute() {
   if (!button.get()) command.start();
 }
コード例 #7
0
ファイル: IO.java プロジェクト: Team3851/Aerial-Assist-2014
  public IO() {
    // BALLISTA CONTROLS
    /*
     * Position
     */
    buttonP2.whenPressed(new EnablePickupPosition(1.0));
    buttonP3.whenPressed(new EnableShootingPosition(1.0));
    buttonP9.whenPressed(new EnableTrussPosition(1.0));
    buttonP8.whenPressed(new DisableInitPosition(1.0));

    /*
     * Shooting
     */
    buttonP11.whenPressed(new PrepareShot());
    buttonP10.whenPressed(new EnableInitPosition(1.0));
    buttonP1.whenPressed(new BallistaFireBall());

    /*
     * Pickup
     */
    buttonP6.whileHeld(new GrabBall());
    buttonP7.whenPressed(new HoldBall(1.0));

    // DEBUG ON LEFT JOYSTICK
    buttonL7.whenPressed(new PinHold(1.0));
    buttonL6.whenPressed(new PinRelease(1.0));

    buttonL10.whenPressed(new PrepareShotNoPinRelease());
    buttonL11.whenPressed(new Release(2.0));
  }
コード例 #8
0
ファイル: IO.java プロジェクト: Team3851/Aerial-Assist-2014
 public boolean getButtonL3() {
   return buttonL3.get();
 }
コード例 #9
0
ファイル: IO.java プロジェクト: Team3851/Aerial-Assist-2014
 public boolean getButtonL2() {
   return buttonL2.get();
 }
コード例 #10
0
ファイル: OI.java プロジェクト: Team1065/FRC-2013
 public boolean getShootButton() {
   return shootButton.get();
 }
コード例 #11
0
ファイル: OI.java プロジェクト: Team1065/FRC-2013
 public boolean getMecanumButton() {
   return mecanumButton.get();
 }
コード例 #12
0
ファイル: OI.java プロジェクト: Team1065/FRC-2013
 public boolean getTracktionButton() {
   return tractionButton.get();
 }
コード例 #13
0
ファイル: OI.java プロジェクト: Team1065/FRC-2013
 public OI() {
   ds = DriverStation.getInstance().getEnhancedIO();
   shooterFeedbackEnableButton.whileHeld(new ShootingWithFeedback());
 }