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

Reordered auto if statements

This commit is contained in:
Austen Adler 2014-10-18 16:27:42 -04:00
parent 4a84b99fff
commit ffd89bb0b8

View File

@ -44,6 +44,17 @@ void HHRobot::RunAuto(){
compressorSystem->ExtendCollector();
//TODO I have no idea what rate this loop runs at so we are going to have to fine tune the times
//Drive for 51 inches/cm/units (or time)
if(step==2){
return;
}
if(step==1 && time<300){
//TODO Pass the shooting power and sonar distance as variables to the RunAuto function
//Shoot at a power
shooter->StartShootingSequence(0.78);
}else{
time=0;
step=2;
}
if(step==0 && time<200){
if(sonar->GetInches("FRONTLEFT")>=51){
DriveRobot(0,-.5);
@ -51,18 +62,9 @@ void HHRobot::RunAuto(){
DriveRobot(0,0);
}
}else{
time=0;
step=1;
}
//TODO Pass the shooting power and sonar distance as variables to the RunAuto function
//Shoot at a power
if(step==1 && time<500){
shooter->StartShootingSequence(0.78);
}else{
step=2;
}
if(step==2){
return;
}
//Important periodic things
netTable->PutNumber("AutoStep",step); //Debugging purposes
time++;