motor aansturing moet lineair zijn is het niet

Dependencies:   MODSERIAL Encoder mbed HIDScope

Revision:
3:c9f9db6581bc
Parent:
2:bcd68150136c
Child:
4:e171c9fa5447
diff -r bcd68150136c -r c9f9db6581bc main.cpp
--- a/main.cpp	Mon Sep 28 09:16:01 2015 +0000
+++ b/main.cpp	Mon Sep 28 09:22:19 2015 +0000
@@ -24,7 +24,9 @@
 {
     if(left < 0.4)
     {
-        float leftin = left*2.5 ;
+        float calc1 = left - 1;
+        float calc2 = abs(calc1);
+        float leftin = (calc2-0.6)*2.5 ;
         motor1_aan.write(leftin);
         motor1_rich.write(0);
     }
@@ -44,7 +46,9 @@
 {
     if(right < 0.4)
     { 
-        float rightin = right*2.5;
+        float calc3 = right - 1;
+        float calc4 = abs(calc3);
+        float rightin = (calc4-0.6)*2.5 ;
         motor2_aan.write(rightin);
         motor2_rich.write(0);
     }