2
0
mirror of https://github.com/team2059/Zaphod synced 2025-01-27 22:21:07 -05:00

Enabled the compressor. Should work because loops runs at lower speed than SimpleTemplate

This commit is contained in:
Adam Long 2014-10-07 11:49:02 -04:00
parent b9b25144b6
commit fdd3561801

View File

@ -3,7 +3,6 @@ HHCompressor::HHCompressor(){
compressor=new Compressor(COMPRESSOR_GAUGE_SIDECAR, COMPRESSOR_GAUGE, COMPRESSOR_RELAY_SIDECAR, COMPRESSOR_RELAY); compressor=new Compressor(COMPRESSOR_GAUGE_SIDECAR, COMPRESSOR_GAUGE, COMPRESSOR_RELAY_SIDECAR, COMPRESSOR_RELAY);
solenoid1=new Solenoid(COMPRESSOR_SOLENOID_ONE); solenoid1=new Solenoid(COMPRESSOR_SOLENOID_ONE);
solenoid2=new Solenoid(COMPRESSOR_SOLENOID_TWO); solenoid2=new Solenoid(COMPRESSOR_SOLENOID_TWO);
time(&t);
} }
void HHCompressor::CompressorSystemPeriodic(){ void HHCompressor::CompressorSystemPeriodic(){
switch(e_CollectorSolenoidState){ switch(e_CollectorSolenoidState){
@ -20,16 +19,10 @@ void HHCompressor::CompressorSystemPeriodic(){
default: default:
break; break;
} }
time_t f; if(compressor->GetPressureSwitchValue()==1){
time(&f); compressor->Start()
printf("%f",difftime(t,f)); }else{
if(difftime(t,f)>1.0f){ compressor->Stop();
if(compressor->GetPressureSwitchValue()==1){
compressor->Start();
}else{
compressor->Stop();
}
t=clock();
} }
e_CollectorSolenoidState=IDLE; e_CollectorSolenoidState=IDLE;
} }