From faf777234db7b42155ebeb39b12e37d976f5f68b Mon Sep 17 00:00:00 2001 From: Aarav Shah <91212@psdschools.org> Date: Wed, 19 Feb 2020 16:25:38 -0700 Subject: [PATCH] Fixed Solenoid to Cool Falcon --- src/main/java/frc4388/robot/RobotContainer.java | 2 +- src/main/java/frc4388/robot/subsystems/Drive.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 80484b4..65199c5 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -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 diff --git a/src/main/java/frc4388/robot/subsystems/Drive.java b/src/main/java/frc4388/robot/subsystems/Drive.java index 58c14fb..9afa4c9 100644 --- a/src/main/java/frc4388/robot/subsystems/Drive.java +++ b/src/main/java/frc4388/robot/subsystems/Drive.java @@ -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;