Fixed Solenoid to Cool Falcon

This commit is contained in:
Aarav Shah
2020-02-19 16:25:38 -07:00
parent cb2489ee9e
commit faf777234d
2 changed files with 6 additions and 2 deletions
@@ -78,7 +78,7 @@ public class RobotContainer {
/* Default Commands */
// drives the robot with a two-axis input from the driver controller
m_robotDrive.setDefaultCommand(new DriveWithJoystickUsingDeadAssistPID(m_robotDrive, getDriverController()));
m_robotDrive.setDefaultCommand(new DriveWithJoystick(m_robotDrive, getDriverController()));
// drives intake with input from triggers on the opperator controller
m_robotIntake.setDefaultCommand(new RunIntakeWithTriggers(m_robotIntake, getOperatorController()));
// drives climber with input from triggers on the opperator controller
@@ -66,7 +66,7 @@ public class Drive extends SubsystemBase {
public DoubleSolenoid m_speedShift;
public DoubleSolenoid m_coolFalcon;
public int m_currentTimeSec = (int)(System.currentTimeMillis() * 1000);
public int m_currentTimeSec = (int)(System.currentTimeMillis() / 1000);
public long m_lastTime, m_deltaTime; //in milliseconds
@@ -271,11 +271,15 @@ public class Drive extends SubsystemBase {
@Override
public void periodic() {
m_currentTimeSec = (int)(System.currentTimeMillis() / 1000);
SmartDashboard.putNumber("Time Seconds", m_currentTimeSec);
if (m_currentTimeSec % 10 == 0) {
coolFalcon(true);
SmartDashboard.putBoolean("Solenoid", true);
} else if ((m_currentTimeSec - 2) % 10 == 0) {
coolFalcon(false);
SmartDashboard.putBoolean("Solenoid", false);
}
m_deltaTime = System.currentTimeMillis() - m_lastTime;