From 89c3489f796ecc7b3a4aa9ff743bed242c746cc0 Mon Sep 17 00:00:00 2001 From: "Keenan D. Buckley" Date: Sat, 16 Feb 2019 20:47:58 -0700 Subject: [PATCH] Add button to lift both intakes --- .../java/org/usfirst/frc4388/robot/OI.java | 4 +-- .../robot/commands/HatchAndBallUp.java | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 2019robot/src/main/java/org/usfirst/frc4388/robot/commands/HatchAndBallUp.java diff --git a/2019robot/src/main/java/org/usfirst/frc4388/robot/OI.java b/2019robot/src/main/java/org/usfirst/frc4388/robot/OI.java index e85ebbe..04ada55 100644 --- a/2019robot/src/main/java/org/usfirst/frc4388/robot/OI.java +++ b/2019robot/src/main/java/org/usfirst/frc4388/robot/OI.java @@ -49,8 +49,8 @@ public class OI CarriageEject.whenPressed(new SetIntakeSpeed(BallIntake.BALL_EXTAKE_SPEED)); CarriageEject.whenReleased(new SetIntakeSpeed(0.0)); - //JoystickButton endEfector = new JoystickButton(m_operatorXbox.getJoyStick(), XboxController.X_BUTTON); - //endEfector.toggleWhenActive(new WristPlacement(true)); + JoystickButton liftBothIntake = new JoystickButton(m_operatorXbox.getJoyStick(), XboxController.X_BUTTON); + liftBothIntake.whenPressed(new HatchAndBallUp()); JoystickButton liftHatchIntake = new JoystickButton(m_operatorXbox.getJoyStick(), XboxController.RIGHT_BUMPER_BUTTON); liftHatchIntake.whenPressed(new LiftHatchDropBall()); diff --git a/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/HatchAndBallUp.java b/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/HatchAndBallUp.java new file mode 100644 index 0000000..91e9b4f --- /dev/null +++ b/2019robot/src/main/java/org/usfirst/frc4388/robot/commands/HatchAndBallUp.java @@ -0,0 +1,35 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2018 FIRST. All Rights Reserved. */ +/* Open Source Software - may be modified and shared by FRC teams. The code */ +/* must be accompanied by the FIRST BSD license file in the root directory of */ +/* the project. */ +/*----------------------------------------------------------------------------*/ + +package org.usfirst.frc4388.robot.commands; + +import edu.wpi.first.wpilibj.command.CommandGroup; + +public class HatchAndBallUp extends CommandGroup { + /** + * Add your docs here. + */ + public HatchAndBallUp() { + addSequential(new HatchFlip(true)); + addParallel(new DeployBallIntake(false)); + // e.g. addSequential(new Command1()); + // addSequential(new Command2()); + // these will run in order. + + // To run multiple commands at the same time, + // use addParallel() + // e.g. addParallel(new Command1()); + // addSequential(new Command2()); + // Command1 and Command2 will run in parallel. + + // A command group will require all of the subsystems that each member + // would require. + // e.g. if Command1 requires chassis, and Command2 requires arm, + // a CommandGroup containing them would require both the chassis and the + // arm. + } +}