2
0
mirror of https://github.com/team2059/Dent synced 2024-12-18 20:52:29 -05:00

Fixed drivetrain locking

This commit is contained in:
Austen Adler 2015-02-06 20:17:26 -05:00
parent 095114b3a2
commit 32834cc28b

View File

@ -9,14 +9,15 @@ void Drive::Initialize(){
void Drive::Execute(){ void Drive::Execute(){
double x,y,z; double x,y,z;
//Code to lock the x axis when not holding button 1 //Code to lock the x axis when not holding button 1
if (DentRobot::oi->GetLeftStick()->GetRawButton(1)){ x = DentRobot::oi->GetLeftStick()->GetRawAxis(0);
x = DentRobot::oi->GetLeftStick()->GetRawAxis(0);
x /= 1.3;
}else{
x = 0;
}
z = DentRobot::oi->GetLeftStick()->GetRawAxis(2); z = DentRobot::oi->GetLeftStick()->GetRawAxis(2);
y = DentRobot::oi->GetLeftStick()->GetRawAxis(1); y = DentRobot::oi->GetLeftStick()->GetRawAxis(1);
if (DentRobot::oi->GetLeftStick()->GetRawButton(1)){
x=0;
}
if (DentRobot::oi->GetLeftStick()->GetRawButton(2)){
y=0;
}
if (DentRobot::oi->GetLeftStick()->GetRawAxis(3)<=0.5){ if (DentRobot::oi->GetLeftStick()->GetRawAxis(3)<=0.5){
y /= 2; y /= 2;
z /= 2; z /= 2;