2
0
mirror of https://github.com/team2059/Zaphod synced 2024-12-18 20:12:28 -05:00

Attempted fixing #5 (Untested)

This commit is contained in:
Austen Adler 2014-10-09 17:18:57 -04:00
parent 1a8882ee43
commit d69dc71e81

View File

@ -254,11 +254,11 @@ public:
//}}} //}}}
//runCompressor{{{ //runCompressor{{{
void runCompressor(int i, int refreshInterval){ void runCompressor(int i, int refreshInterval){
if(i%refreshInterval==0&compressing&compressor.GetPressureSwitchValue()==1){ if(i%refreshInterval==0&&compressing&&compressor.GetPressureSwitchValue()==1){
compressing=false; compressing=false;
compressor.Stop(); compressor.Stop();
} }
if(i%refreshInterval==0&!compressing&compressor.GetPressureSwitchValue()==0){ if(i%refreshInterval==0&&!compressing&&compressor.GetPressureSwitchValue()==0&&shooter_idle){
compressing=true; compressing=true;
compressor.Start(); compressor.Start();
} }
@ -632,6 +632,8 @@ public:
//}}} //}}}
//Shoot{{{ //Shoot{{{
if(Lstick.GetRawButton(1)==1){ if(Lstick.GetRawButton(1)==1){
compressing=false;
compressor.Stop();
shooter_idle=false; //Cause the robot to start the shooting sequence shooter_idle=false; //Cause the robot to start the shooting sequence
} }
//}}} //}}}
@ -693,5 +695,5 @@ public:
} }
} }
//}}} //}}}
}; }
START_ROBOT_CLASS(RobotDemo); START_ROBOT_CLASS(RobotDemo);