Dependencies:   mbed Servo mbed-rtos Motor

Files at this revision

API Documentation at this revision

Comitter:
npatel387
Date:
Wed Apr 29 00:50:56 2020 +0000
Parent:
12:439c0b3f0673
Commit message:
Revert to previous version with updated parameter values

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 439c0b3f0673 -r ec72079880e9 main.cpp
--- 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
         {