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