| 1 | package org.usfirst.frc.team3501.robot; |
| 2 | |
| 3 | import org.usfirst.frc.team3501.robot.subsystems.DriveTrain; |
| 4 | import org.usfirst.frc.team3501.robot.subsystems.Intake; |
| 5 | import org.usfirst.frc.team3501.robot.subsystems.Shooter; |
| 6 | import org.usfirst.frc.team3501.robot.utils.HallEffectSensor; |
| 7 | |
| 8 | import edu.wpi.first.wpilibj.IterativeRobot; |
| 9 | import edu.wpi.first.wpilibj.command.Scheduler; |
| 10 | |
| 11 | public class Robot extends IterativeRobot { |
| 12 | private static DriveTrain driveTrain; |
| 13 | private static Shooter shooter; |
| 14 | private static OI oi; |
| 15 | private static Intake intake; |
| 16 | private HallEffectSensor hallEffect; |
| 17 | |
| 18 | @Override |
| 19 | public void robotInit() { |
| 20 | driveTrain = DriveTrain.getDriveTrain(); |
| 21 | oi = OI.getOI(); |
| 22 | shooter = Shooter.getShooter(); |
| 23 | intake = Intake.getIntake(); |
| 24 | |
| 25 | hallEffect = Shooter.getHallEffectSensor(); |
| 26 | } |
| 27 | |
| 28 | public static DriveTrain getDriveTrain() { |
| 29 | return DriveTrain.getDriveTrain(); |
| 30 | } |
| 31 | |
| 32 | public static Shooter getShooter() { |
| 33 | return Shooter.getShooter(); |
| 34 | } |
| 35 | |
| 36 | public static OI getOI() { |
| 37 | return OI.getOI(); |
| 38 | } |
| 39 | |
| 40 | public static Intake getIntake() { |
| 41 | return Intake.getIntake(); |
| 42 | } |
| 43 | |
| 44 | // If the gear values do not match in the left and right piston, then they are |
| 45 | // both set to high gear |
| 46 | @Override |
| 47 | public void autonomousInit() { |
| 48 | driveTrain.setHighGear(); |
| 49 | } |
| 50 | |
| 51 | @Override |
| 52 | public void autonomousPeriodic() { |
| 53 | Scheduler.getInstance().run(); |
| 54 | |
| 55 | } |
| 56 | |
| 57 | @Override |
| 58 | public void teleopInit() { |
| 59 | |
| 60 | } |
| 61 | |
| 62 | @Override |
| 63 | public void teleopPeriodic() { |
| 64 | Scheduler.getInstance().run(); |
| 65 | System.out.println("Hall Effect Period: " + hallEffect.getCounterPeriod()); |
| 66 | } |
| 67 | } |