|
12 | 12 | import edu.wpi.first.wpilibj.DriverStation; |
13 | 13 | import frc.robot.commands.DriveWithJoysticks; |
14 | 14 | import frc.robot.commands.Detector; |
| 15 | +import frc.robot.commands.Shootball; |
15 | 16 | import frc.robot.subsystems.DriveTrain; |
16 | 17 | import frc.robot.subsystems.Shooter; |
17 | 18 | import frc.robot.subsystems.Winch; |
|
21 | 22 | import com.revrobotics.ColorMatchResult; |
22 | 23 |
|
23 | 24 | public class Robot extends TimedRobot { |
| 25 | + |
24 | 26 | XboxController xbox = RobotMap.xboxController; |
25 | 27 | Joystick leftstick = RobotMap.leftJoystick; |
26 | 28 | Joystick rightstick = RobotMap.rightJoystick; |
27 | 29 |
|
28 | 30 | public static DriveTrain driveTrain; |
| 31 | + public static Shooter shooter; |
29 | 32 | public static OI OI; |
30 | 33 | public static String colorString; |
31 | | - |
| 34 | + |
32 | 35 | double shooterVel; |
33 | 36 | boolean Xon = false; |
34 | 37 | boolean GreenLED_ON = false; |
@@ -92,6 +95,8 @@ public void teleopInit() { |
92 | 95 | RobotMap.GreenLED.set(Relay.Value.kOn); |
93 | 96 | RobotMap.GreenLED.set(Relay.Value.kReverse); |
94 | 97 |
|
| 98 | + Scheduler.getInstance().add(new Shootball()); |
| 99 | + |
95 | 100 | // Init OI |
96 | 101 | OICommands(); |
97 | 102 | } |
@@ -125,6 +130,8 @@ public void robotPeriodic() { |
125 | 130 | SmartDashboard.putNumber("Rotations Completed", ColorCycle.colorCycleValue); |
126 | 131 | SmartDashboard.putNumber("Colors Passed", ColorCycle.colorsPassedValue); |
127 | 132 | SmartDashboard.putNumber("Shooter Velocity", -1 * shooterVel); |
| 133 | + SmartDashboard.putNumber("Top Limit switch", RobotMap.topLimitSwitch.get() ? 1:0); // converts boolean to int |
| 134 | + SmartDashboard.putNumber("Bottom Limit Switch", RobotMap.bottomLimitSwitch.get() ? 1:0); |
128 | 135 |
|
129 | 136 | if (ColorCycle.colorCycleValue == 3) { |
130 | 137 | ColorCycle.colorCycleStop(); |
@@ -174,21 +181,6 @@ public void teleopPeriodic() { |
174 | 181 | } |
175 | 182 | } |
176 | 183 |
|
177 | | - if (OI.shoot() == true) { |
178 | | - for (shooterCycle = 0; shooterCycle < 500; shooterCycle++) { |
179 | | - Shooter.initiateShot(OI.valueShooterSpeed); |
180 | | - System.out.println("Ramping up shooter"); |
181 | | - shooterVel = RobotMap.CANCoder.getVelocity(); |
182 | | - if (shooterCycle >= 100) { |
183 | | - Shooter.loadingShot(); |
184 | | - System.out.println("loading ball for shooting"); |
185 | | - } |
186 | | - } |
187 | | - } else { |
188 | | - Shooter.shooterStop(); |
189 | | - shooterVel = RobotMap.CANCoder.getVelocity(); |
190 | | - } |
191 | | - |
192 | 184 | if (OI.changeShooterSpeed() == 1) { |
193 | 185 | if (OI.valueShooterSpeed < 1) { |
194 | 186 | OI.valueShooterSpeed = OI.valueShooterSpeed + 0.02; |
|
0 commit comments