diff --git a/src/HHBase.cpp b/src/HHBase.cpp index 1d641b2..88f5c86 100644 --- a/src/HHBase.cpp +++ b/src/HHBase.cpp @@ -1,5 +1,4 @@ #include "HHBase.h" - HHBase::HHBase(): hHBot(new HHRobot()){ printf("Done\n"); diff --git a/src/HHRobot.cpp b/src/HHRobot.cpp index 1b54013..52a4676 100644 --- a/src/HHRobot.cpp +++ b/src/HHRobot.cpp @@ -36,6 +36,7 @@ void HHRobot::DriveRobot(float x, float y){ void HHRobot::UpdateDashboard(){ dashboard->PutFloatValue("Shooting Power", ControlSystem->throttle); } + //Main function used to handle periodic tasks on the robot void HHRobot::Handler(){ //Periodic tasks that should be run by every loop diff --git a/src/Subsystems/Compressor.cpp b/src/Subsystems/Compressor.cpp index 39f6584..08bd189 100644 --- a/src/Subsystems/Compressor.cpp +++ b/src/Subsystems/Compressor.cpp @@ -9,26 +9,22 @@ void HHCompressor::CompressorSystemPeriodic(){ case EXTENDED: solenoid1->Set(false); solenoid2->Set(true); - e_CollectorSolenoidState = IDLE; break; case RETRACTED: solenoid1->Set(true); solenoid2->Set(false); - e_CollectorSolenoidState = IDLE; break; case IDLE: - e_CollectorSolenoidState = IDLE; break; default: break; } - //e_CollectorSolenoidState=IDLE; -} -void HHCompressor::StartCompressing(){ - compressor->Start(); -} -void HHCompressor::StopCompressing(){ - compressor->Stop(); + e_CollectorSolenoidState=IDLE; + if(compressor->GetPressureSwitchValue()==1){ + compressor->Start(); + }else{ + compressor->Stop(); + } } void HHCompressor::ExtendCollector(){ e_CollectorSolenoidState=EXTENDED; diff --git a/src/Subsystems/Compressor.h b/src/Subsystems/Compressor.h index 9dcfc4b..20040c2 100644 --- a/src/Subsystems/Compressor.h +++ b/src/Subsystems/Compressor.h @@ -14,6 +14,4 @@ class HHCompressor{ void CompressorSystemPeriodic(); void ExtendCollector(); void RetractCollector(); - void StartCompressing(); - void StopCompressing(); };