add printdata button and command
authorCindy Zhang <cindyzyx9@gmail.com>
Wed, 17 Feb 2016 21:40:21 +0000 (13:40 -0800)
committerCindy Zhang <cindyzyx9@gmail.com>
Tue, 23 Feb 2016 00:22:21 +0000 (16:22 -0800)
src/org/usfirst/frc/team3501/robot/OI.java
src/org/usfirst/frc/team3501/robot/commands/shooter/PrintData.java [new file with mode: 0644]

index b59b6e08b14bcf3d53a76e1a25d4b2ab5aaad3f4..cc5dcc5d467bec867243f0722612c647ec0f8c43 100644 (file)
@@ -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 (file)
index 0000000..cf88f70
--- /dev/null
@@ -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));
+    }
+  }
+}