statemachine

Dependencies:   mbed QEI HIDScope biquadFilter MODSERIAL FastPWM

Revision:
3:ea5f67f11825
Parent:
2:38ec7638236e
Child:
4:3e9a8f5d9a1a
--- a/main.cpp	Tue Sep 10 14:01:45 2019 +0000
+++ b/main.cpp	Fri Sep 20 07:22:47 2019 +0000
@@ -1,21 +1,24 @@
 #include "mbed.h"
-#include "MODSERIAL.h"
-DigitalOut myled2(LED_RED);
-DigitalOut myled(LED_BLUE);
-MODSERIAL pc(USBTX, USBRX);
- 
-int main()
-{
-    pc.printf("\rhallo\n");
-    
-    while (true) {
-        pc.printf("\r");
-        char c;
-        c= pc.getc();
-        myled =!myled;
-        myled2 =!myled2;
-        pc.printf("\n\r");
-        pc.putc(c);
+#include "MODSERIAL.h";
+#include "FastPWM.h" ;
+
+InterruptIn button1(PTC2);
+InterruptIn button2(PTC3);
+AnalogIn pot(PTB2);
+Serial pc(USBTX,USBRX);
+FastPWM led(PTA2);
+InterruptIn button3(PTA4);
+InterruptIn button4(PTC6);
+
+float ledb = 0.5f;
+
+int main(){ 
+    printf("Controll with dial\n");    
+        led.period(0.01f) ;
+        led.write(0.5f) ;
+        while(true){
+            wait(0.01);
+            printf("analog input is (%f)\n\r",pot.read()); wait(0.1);
+            led.write(pot);
+            }
     }
-}
- 
\ No newline at end of file