Dependencies:   mbed Servo mbed-rtos Motor

Revision:
13:ec72079880e9
Parent:
12:439c0b3f0673
--- a/main.cpp	Wed Apr 29 00:11:16 2020 +0000
+++ b/main.cpp	Wed Apr 29 00:50:56 2020 +0000
@@ -77,7 +77,7 @@
     float rightMotorSpeed = 0.0;
     
     int encoderCountDifference = 0;
-    const int countDifferenceTolerance = 8; //How many counts difference between encoders is allowed
+    const int countDifferenceTolerance = 8; //How many counts difference between encoders is allowed (8 per rotation)
     
     while(1){
     if(leftJoystickState != 0 && rightJoystickState != 0 && leftJoystickState == rightJoystickState) //only need to match speeds if they're moving in same direction
@@ -97,7 +97,6 @@
             interruptAttached = true;
         }
         
-        Thread::wait(1000);
         encoderCountDifference = leftEncoderCount - rightEncoderCount;
         if(encoderCountDifference > countDifferenceTolerance) //if left encoder counted more, left motor is faster
         {