From: Cindy Zhang Date: Wed, 17 Feb 2016 21:40:21 +0000 (-0800) Subject: add printdata button and command X-Git-Url: http://challenge-bot.com/repos/?a=commitdiff_plain;h=a53570886f674b3f0bcaa423c5018dcf27bd31b1;p=3501%2Fstronghold-2016 add printdata button and command --- diff --git a/src/org/usfirst/frc/team3501/robot/OI.java b/src/org/usfirst/frc/team3501/robot/OI.java index b59b6e08..cc5dcc5d 100644 --- a/src/org/usfirst/frc/team3501/robot/OI.java +++ b/src/org/usfirst/frc/team3501/robot/OI.java @@ -1,5 +1,6 @@ package org.usfirst.frc.team3501.robot; +import org.usfirst.frc.team3501.robot.commands.shooter.PrintData; import org.usfirst.frc.team3501.robot.commands.shooter.RecordData; import org.usfirst.frc.team3501.robot.commands.shooter.Test1; import org.usfirst.frc.team3501.robot.commands.shooter.Test2; @@ -16,6 +17,7 @@ public class OI { public static Button shoot; public static Button incrementSpeed; public static Button decrementSpeed; + public static Button printData; // // first column of arcade buttons - getting past defenses // public static DigitalButton passPortcullis; @@ -97,13 +99,17 @@ public class OI { shoot.whenPressed(new Test1()); incrementSpeed = new JoystickButton(leftJoystick, - Constants.OI.SPIN2_PORT); + Constants.OI.LEFT_JOYSTICK_TOP_CENTER_PORT); incrementSpeed.whenPressed(new Test2()); decrementSpeed = new JoystickButton(leftJoystick, Constants.OI.LEFT_JOYSTICK_TOP_LOW_PORT); decrementSpeed.whenPressed(new Test3()); + printData = new JoystickButton(leftJoystick, + Constants.OI.SPIN2_PORT); + printData.whenPressed(new PrintData()); + // SpinRobot180_1 = new JoystickButton(leftJoystick, // Constants.OI.SPIN1_PORT); // SpinRobot180_1.whenPressed(new Turn180()); diff --git a/src/org/usfirst/frc/team3501/robot/commands/shooter/PrintData.java b/src/org/usfirst/frc/team3501/robot/commands/shooter/PrintData.java new file mode 100644 index 00000000..cf88f70a --- /dev/null +++ b/src/org/usfirst/frc/team3501/robot/commands/shooter/PrintData.java @@ -0,0 +1,18 @@ +package org.usfirst.frc.team3501.robot.commands.shooter; + +import org.usfirst.frc.team3501.robot.Constants; + +import edu.wpi.first.wpilibj.command.CommandGroup; + +/** + * + */ +public class PrintData extends CommandGroup { + + public PrintData() { + for (int i = 0; i < Constants.Shooter.speeds.size(); i++) { + System.out.println("speed: " + Constants.Shooter.speeds.get(i) + + ", distance: " + Constants.Shooter.distances.get(i)); + } + } +}