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

Fixed half speed in auto and in teleop (Untested)

This commit is contained in:
Austen Adler 2014-04-04 20:29:38 -04:00
parent 087604037e
commit 3668bf318d

View File

@ -146,12 +146,12 @@ public:
}else if(y!=0.0f&&y<-1.0f){ }else if(y!=0.0f&&y<-1.0f){
y=-1.0f; y=-1.0f;
} }
if(SmartDashboard::GetBoolean("HalfPower")){
x/=2;
y/=2;
}
int leftPower=((y+x)/2+1)*127+1; int leftPower=((y+x)/2+1)*127+1;
int rightPower=((y-x)/2+1)*127+1; int rightPower=((y-x)/2+1)*127+1;
if(SmartDashboard::GetBoolean("HalfPower")){
leftPower/=2;
rightPower/=2;
}
setMotorValue(1,1,leftPower); setMotorValue(1,1,leftPower);
setMotorValue(2,1,leftPower); setMotorValue(2,1,leftPower);
setMotorValue(3,1,leftPower); setMotorValue(3,1,leftPower);
@ -501,6 +501,7 @@ public:
//}}} //}}}
//}}} //}}}
} }
}
SmartDashboard::PutNumber("Autonomous step", currentStep); SmartDashboard::PutNumber("Autonomous step", currentStep);
updateDashboard(); updateDashboard();
//Compressor{{{ //Compressor{{{
@ -511,7 +512,6 @@ public:
i++; i++;
c++; c++;
Wait(0.005f); Wait(0.005f);
}
compressing=false; compressing=false;
compressor.Stop(); compressor.Stop();
} }