Motor speed controlled by potmeter

Dependencies:   mbed QEI HIDScope biquadFilter MODSERIAL FastPWM

Revision:
11:ea15cf0230cd
Parent:
10:76dfdbdd20cd
Child:
12:0c32e66fc4db
--- a/main.cpp	Thu Oct 03 13:26:09 2019 +0000
+++ b/main.cpp	Thu Oct 03 13:45:54 2019 +0000
@@ -25,18 +25,15 @@
   motor1 = 1;
   while(true)
   {
-    int value;
-  for(value = 100 ; value <= 255; value+=5)
-  {
+    float value = pot1.read();
     motor1.write(1);
     motor2.write(1);
     e1.write(value);   //PWM Speed Control
     e2.write(value);   //PWM Speed Control
     wait_ms(50);
     pc.printf("%i   ",enc1.getPulses());
-    }
+    pc.printf("%f    ",pot1.read());
     
-    wait_ms(500);
     }
     
 } 
\ No newline at end of file