From 32834cc28b391ad854cc089bd9d9aded9a0a69b3 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Fri, 6 Feb 2015 20:17:26 -0500 Subject: [PATCH] Fixed drivetrain locking --- Commands/Drivetrain/Drive.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Commands/Drivetrain/Drive.cpp b/Commands/Drivetrain/Drive.cpp index 9d0e199..6d39788 100644 --- a/Commands/Drivetrain/Drive.cpp +++ b/Commands/Drivetrain/Drive.cpp @@ -9,14 +9,15 @@ void Drive::Initialize(){ void Drive::Execute(){ double x,y,z; //Code to lock the x axis when not holding button 1 - if (DentRobot::oi->GetLeftStick()->GetRawButton(1)){ - x = DentRobot::oi->GetLeftStick()->GetRawAxis(0); - x /= 1.3; - }else{ - x = 0; - } + x = DentRobot::oi->GetLeftStick()->GetRawAxis(0); z = DentRobot::oi->GetLeftStick()->GetRawAxis(2); 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){ y /= 2; z /= 2;