motor aansturing moet lineair zijn is het niet

Dependencies:   MODSERIAL Encoder mbed HIDScope

Revision:
2:bcd68150136c
Parent:
1:8918d924f625
Child:
3:c9f9db6581bc
--- a/main.cpp	Mon Sep 28 09:14:12 2015 +0000
+++ b/main.cpp	Mon Sep 28 09:16:01 2015 +0000
@@ -34,9 +34,7 @@
     }
     else if(left > 0.6)
     {
-        float calc = left - 1;
-        float calc2 = abs(calc);
-        float leftin = calc2*2.5;
+        float leftin = (left-0.6)*2.5;
         motor1_aan.write(leftin);
         motor1_rich.write(1);
     }
@@ -56,9 +54,7 @@
     }
     else if(right > 0.6)
     {
-        float calc3 = right-1;
-        float calc4 = abs(calc3);
-        float rightin = calc4*2.5;
+        float rightin = (right-0.6)*2.5;
         motor2_aan.write(rightin);
         motor2_rich.write(1);
     }