package org.usfirst.frc.team3501.robot;
+import org.usfirst.frc.team3501.robot.commands.intakearm.RecordPotAngle;
+
import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.buttons.Button;
+import edu.wpi.first.wpilibj.buttons.JoystickButton;
public class OI {
public static Joystick leftJoystick;
public static Joystick rightJoystick;
+ public static Button recordPotAngle;
+
// // first column of arcade buttons - getting past defenses
// public static DigitalButton passPortcullis;
// public static DigitalButton passChevalDeFrise;
leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
+ recordPotAngle = new JoystickButton(leftJoystick,
+ Constants.OI.LEFT_JOYSTICK_TOP_CENTER_PORT);
+ recordPotAngle.whenPressed(new RecordPotAngle());
+
// passPortcullis = new DigitalButton(
// new DigitalInput(Constants.OI.PASS_PORTCULLIS_PORT));
// passPortcullis.whenPressed(new PassPortcullis());
// Sendable Choosers send a drop down menu to the Smart Dashboard.
SendableChooser positionChooser;
SendableChooser positionOneDefense, positionTwoDefense, positionThreeDefense,
- positionFourDefense, positionFiveDefense;
+ positionFourDefense, positionFiveDefense;
// Gyro stuff
public GyroLib gyro;
@Override
public void robotInit() {
// driveTrain = new DriveTrain();
- // oi = new OI();
+ oi = new OI();
// gyro = new GyroLib(I2C.Port.kOnboard, false);
//
// shooter = new Shooter();
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.intakearm;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/**
+ *
+ */
+public class RecordPotAngle extends Command {
+
+ public RecordPotAngle() {
+ requires(Robot.intakeArm);
+ }
+
+ // Called just before this Command runs the first time
+ @Override
+ protected void initialize() {
+ Robot.intakeArm.potAngles[0] = Robot.intakeArm.getArmAngle();
+ }
+
+ // Called repeatedly when this Command is scheduled to run
+ @Override
+ protected void execute() {
+ }
+
+ // Make this return true when this Command no longer needs to run execute()
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ // Called once after isFinished returns true
+ @Override
+ protected void end() {
+ }
+
+ // Called when another command which requires one or more of the same
+ // subsystems is scheduled to run
+ @Override
+ protected void interrupted() {
+ }
+}