From fdd3561801263c34450674a7d04ddda08667f45d Mon Sep 17 00:00:00 2001 From: Adam Long Date: Tue, 7 Oct 2014 11:49:02 -0400 Subject: [PATCH] Enabled the compressor. Should work because loops runs at lower speed than SimpleTemplate --- src/Subsystems/Compressor.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/Subsystems/Compressor.cpp b/src/Subsystems/Compressor.cpp index efdd133..16e6438 100644 --- a/src/Subsystems/Compressor.cpp +++ b/src/Subsystems/Compressor.cpp @@ -3,7 +3,6 @@ HHCompressor::HHCompressor(){ compressor=new Compressor(COMPRESSOR_GAUGE_SIDECAR, COMPRESSOR_GAUGE, COMPRESSOR_RELAY_SIDECAR, COMPRESSOR_RELAY); solenoid1=new Solenoid(COMPRESSOR_SOLENOID_ONE); solenoid2=new Solenoid(COMPRESSOR_SOLENOID_TWO); - time(&t); } void HHCompressor::CompressorSystemPeriodic(){ switch(e_CollectorSolenoidState){ @@ -20,16 +19,10 @@ void HHCompressor::CompressorSystemPeriodic(){ default: break; } - time_t f; - time(&f); - printf("%f",difftime(t,f)); - if(difftime(t,f)>1.0f){ - if(compressor->GetPressureSwitchValue()==1){ - compressor->Start(); - }else{ - compressor->Stop(); - } - t=clock(); + if(compressor->GetPressureSwitchValue()==1){ + compressor->Start() + }else{ + compressor->Stop(); } e_CollectorSolenoidState=IDLE; }