Ramon Waninge / Mbed 2 deprecated Milestone1

Dependencies:   FastPWM mbed QEI biquadFilter HIDScope MODSERIAL

Revision:
4:0c27632b453a
Parent:
3:d39285fdd103
Child:
5:047db32db712
--- a/main.cpp	Tue Sep 25 14:46:02 2018 +0000
+++ b/main.cpp	Tue Sep 25 15:27:39 2018 +0000
@@ -5,19 +5,21 @@
 Ticker motor;
 
 FastPWM pin5(D5);
-AnalogOut pot1(pot1);
-AnalogOut pot2(pot2);
+AnalogIn pot1(A1);
+//AnalogOut pot2(A2);
 DigitalOut pin4(D4);
-float u  = pot1 - pot2;
+//float u  = pot1;
 
 void draai(){
-    u  = pot1 - pot2;
-    if (u>0){
-        pin4 = true;
-    }
-    else if(u<0){
-        pin4 = false;    
-    }
+    float u  = pot1;
+
+    //if (u>0){
+   //     pin4 = true;
+   // }
+   // else if(u<0){
+   //     pin4 = false;    
+   // }
+   pin4 = true;// u > 0.0f;
     pin5 = fabs(u);
 }
 int main(){
@@ -25,6 +27,6 @@
    pin5.period_us(60);
    motor.attach(draai, 0.001);
    while(true){
-      pin5.write(u);
+       
     }
 }
\ No newline at end of file