Dependencies:   mbed QEI HIDScope biquadFilter MODSERIAL FXOS8700Q FastPWM

Revision:
4:f988679bf9a1
Parent:
3:46c11151e0fd
Child:
5:cee5f898b350
--- a/main.cpp	Wed Sep 11 09:38:22 2019 +0000
+++ b/main.cpp	Wed Sep 11 09:47:18 2019 +0000
@@ -9,10 +9,33 @@
 DigitalOut ledred(LED_RED);
 DigitalOut ledblue(LED_BLUE);
 DigitalOut ledgreen(LED_GREEN);
+InterruptIn button(SW2);
+button.fall(PrintColor);
+
 
 MODSERIAL pc(USBTX, USBRX);
 Ticker Theticker;
 volatile char c='x';
+void PrintColor(void)
+{
+    switch(c)
+    {
+        case 'r':
+        pc.printf("Red");
+        break;
+        case 'g':
+        pc.printf("Green");
+        break;
+        case 'b':
+        pc.printf("Blue");
+        break;
+        case 'd':
+        pc.printf("Disco");
+        break;
+        default:
+        pc.printf("Unknown");
+    }
+}
 void Take_Measurement(void)
 {
     if (c=='r')