X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2FRobot.java;h=99f66213b193728ddf53e4f1927785d979df62e9;hb=fc2f06d4080456fcac3e3a8411805776894dd790;hp=0aad2a670a5b60c7e76d0fd051b78be9afdb6e38;hpb=53f43a7284430f75a877db7ceffe0342737af760;p=3501%2Fstronghold-2016 diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index 0aad2a67..99f66213 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -1,13 +1,13 @@ package org.usfirst.frc.team3501.robot; import org.usfirst.frc.team3501.robot.Constants.Defense; +import org.usfirst.frc.team3501.robot.sensors.Photogate; import org.usfirst.frc.team3501.robot.subsystems.DefenseArm; import org.usfirst.frc.team3501.robot.subsystems.DriveTrain; import org.usfirst.frc.team3501.robot.subsystems.IntakeArm; import org.usfirst.frc.team3501.robot.subsystems.Scaler; import org.usfirst.frc.team3501.robot.subsystems.Shooter; -import edu.wpi.first.wpilibj.I2C; import edu.wpi.first.wpilibj.IterativeRobot; import edu.wpi.first.wpilibj.command.Scheduler; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; @@ -23,19 +23,17 @@ public class Robot extends IterativeRobot { public static IntakeArm intakeArm; public static DefenseArm defenseArm; + public static Photogate photogate; + // Sendable Choosers send a drop down menu to the Smart Dashboard. SendableChooser positionChooser; SendableChooser positionOneDefense, positionTwoDefense, positionThreeDefense, - positionFourDefense, positionFiveDefense; - - // Gyro stuff - public GyroLib gyro; + positionFourDefense, positionFiveDefense; @Override public void robotInit() { driveTrain = new DriveTrain(); oi = new OI(); - gyro = new GyroLib(I2C.Port.kOnboard, false); shooter = new Shooter(); scaler = new Scaler(); @@ -112,18 +110,16 @@ public class Robot extends IterativeRobot { Integer chosenPosition = (Integer) positionChooser.getSelected(); Integer chosenDefense = 0; - switch (chosenPosition) { - case 1: + if (chosenPosition == 1) chosenDefense = (Integer) positionOneDefense.getSelected(); - case 2: + else if (chosenPosition == 2) chosenDefense = (Integer) positionTwoDefense.getSelected(); - case 3: + else if (chosenPosition == 3) chosenDefense = (Integer) positionThreeDefense.getSelected(); - case 4: + else if (chosenPosition == 4) chosenDefense = (Integer) positionFourDefense.getSelected(); - case 5: + else if (chosenPosition == 5) chosenDefense = (Integer) positionFiveDefense.getSelected(); - } System.out.println("Chosen Position: " + chosenPosition); System.out.println("Chosen Defense: " + chosenDefense); @@ -136,17 +132,11 @@ public class Robot extends IterativeRobot { @Override public void teleopInit() { - - gyro.start(); - } @Override public void teleopPeriodic() { Scheduler.getInstance().run(); - - System.out.println("Degrees: " + gyro.getRotationZ().getAngle()); - } }