changes to motor library

Dependents:   pid-car-example

Fork of motor by Lawrence Harlow

Branch:
motorupdate
Revision:
13:c43f157a6bac
Parent:
11:4a6f97cc1f1e
Child:
14:bc77edc4adb0
--- a/motor.cpp	Tue Nov 15 11:50:51 2016 +0000
+++ b/motor.cpp	Sun Nov 20 12:48:25 2016 +0000
@@ -182,7 +182,8 @@
     
     
     
-// this is a function whihc works off of the duty cycle. NO SENSOR REQUIREMENT
+// tThis is a function which works off of the duty cycle. NO SENSOR REQUIREMENT
+// CLEAN THIS UP AND UPDATE  FOR SENSORS VERSION WITH THIS CODE
 void dutyCycleCorner( float speed, float angle)
 {
         
@@ -190,7 +191,7 @@
         //float radius= center(middlePoint);
         
         bool leftOrRight;
-        float theta = angle/0.02222f;
+        //float theta = angle/0.02222f;
         if(theta<0)
         {
          leftOrRight=true;
@@ -202,8 +203,8 @@
        
         
         //float radius = 0.6;
-        float x = tan(theta* (3.14f / 180.0f));
-        float deltaW = ((0.2f*x)/0.2f)*speed;
+        //float x = tan(theta* (3.14f / 180.0f));
+        float deltaW = ((0.2f*tan((angle/0.02222f)* (3.14f / 180.0f)))/0.2f)*speed;
         float w1=speed+ deltaW;
         float w2= speed- deltaW;