changes to motor library

Dependents:   pid-car-example

Fork of motor by Lawrence Harlow

Branch:
motorupdate
Revision:
35:f5933039b560
Parent:
34:7e59011ca978
Parent:
33:734ce4c36c3f
Child:
36:8b6c896e1ab5
--- a/motor.cpp	Fri Jan 13 10:05:58 2017 +0000
+++ b/motor.cpp	Fri Jan 13 10:07:27 2017 +0000
@@ -151,9 +151,9 @@
         }
         
     //this limits the ED to stop it spinning out at high speeds.
-    if(theta>0.5)
+    if(theta>0.4)
     {
-     theta = 0.5;   
+     theta = 0.4;   
         
     }
     
@@ -180,12 +180,15 @@
     }
     
     else{
-        //calulates the speed in eack wheel.
+        //calulates the speed in eack wheel
+        //speed of inner wheel
         float vin = speed*(2 - 0.1/tan((theta/0.022222)*(3.14f / 180.0f)));
+        //speed of outer wheel.
         float vout = speed*(2 + 0.1/tan((theta/0.022222)*(3.14f / 180.0f)));
         if(leftOrRight){
           
           w1=vout;
+          
           w2=vin;
           
           }