E=MC / Mbed 2 deprecated coolcarsuperfast2

Dependencies:   mbed MODSERIAL telemetry-master

Fork of coolcarsuperfast by Michael Romain

Revision:
13:5be515371946
Parent:
12:48b76450c4b4
Child:
14:888495814f3c
--- a/main.cpp	Thu Apr 09 05:07:19 2015 +0000
+++ b/main.cpp	Thu Apr 09 05:48:35 2015 +0000
@@ -84,8 +84,9 @@
 
 int numInterrupts = 0;
 
-float pulsewidth = 0.2f;
-
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~PWM~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
+float pulsewidth = 0.15f;
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // Hardware periods
 float motorPeriod = .0025;
 float servoPeriod = .0025;
@@ -443,16 +444,16 @@
             }
 
             //Change speed when turning at different angles
-            /*if(approxPos > 0 && approxPos <= 45){
-                    motor1.pulsewidth(motorPeriod*(pulsewidth/2));
-                    motor2.pulsewidth(motorPeriod*(pulsewidth/2));
+            if(approxPos > 0 && approxPos <= 45){
+                    motor1.pulsewidth(motorPeriod*(pulsewidth*0.66f));
+                    motor2.pulsewidth(motorPeriod*(pulsewidth*0.66f));
             } else if (approxPos > 45 && approxPos <= 95){
                     motor1.pulsewidth(motorPeriod*pulsewidth);
                     motor2.pulsewidth(motorPeriod*pulsewidth);
             } else {
-                motor1.pulsewidth(motorPeriod*(pulsewidth/2));
-                motor2.pulsewidth(motorPeriod*(pulsewidth/2));
-            }*/
+                motor1.pulsewidth(motorPeriod*(pulsewidth*0.66f));
+                motor2.pulsewidth(motorPeriod*(pulsewidth*0.66f));
+            }
             
             servo.pulsewidth(currDir);