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

Added a half power switch that disables auto and moves robot at half power

This commit is contained in:
Austen Adler 2014-03-31 15:06:14 -04:00
parent 13a1d2d6c6
commit c1babe139a

View File

@ -104,6 +104,7 @@ public:
SmartDashboard::PutNumber("ShooterButtonPower7",1.0f); SmartDashboard::PutNumber("ShooterButtonPower7",1.0f);
SmartDashboard::PutNumber("ShooterButtonPower8",0.5f); SmartDashboard::PutNumber("ShooterButtonPower8",0.5f);
//Bool switches //Bool switches
SmartDashboard::PutBoolean("HalfPower",false);
SmartDashboard::PutBoolean("OneBallAuto",false); SmartDashboard::PutBoolean("OneBallAuto",false);
SmartDashboard::PutBoolean("Use Ultrasonic",true); SmartDashboard::PutBoolean("Use Ultrasonic",true);
SmartDashboard::PutBoolean("Daniel Mode",false); SmartDashboard::PutBoolean("Daniel Mode",false);
@ -147,6 +148,10 @@ public:
} }
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);
@ -263,6 +268,7 @@ public:
SmartDashboard::PutBoolean("CollectorState",true); SmartDashboard::PutBoolean("CollectorState",true);
//}}} //}}}
while(IsEnabled()&&IsAutonomous()){ while(IsEnabled()&&IsAutonomous()){
if(!SmartDashboard::GetBoolean("HalfPower")){
switch (SmartDashboard::GetNumber("Autonomous Sequence")){ switch (SmartDashboard::GetNumber("Autonomous Sequence")){
//Autonomous0{{{ //Autonomous0{{{
case 0: case 0:
@ -477,6 +483,7 @@ public:
break; break;
//}}} //}}}
} }
}
SmartDashboard::PutNumber("Autonomous step",currentStep); SmartDashboard::PutNumber("Autonomous step",currentStep);
updateDashboard(); updateDashboard();
//Compressor{{{ //Compressor{{{