Tristan Vlogman / Mbed 2 deprecated locomotion_pid_action_refactor_EMG

Dependencies:   FastPWM HIDScope MODSERIAL QEI Matrix biquadFilter controller errorFetch mbed motorConfig refGen MatrixMath inverseKinematics

Fork of Minor_test_serial by First Last

Files at this revision

API Documentation at this revision

Comitter:
tvlogman
Date:
Tue Sep 12 15:07:38 2017 +0000
Parent:
2:002f6b69ebaf
Child:
4:f74c981d9bc0
Child:
6:5f433011819f
Commit message:
Added variable keyPress which stores the character key pressed;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Sep 12 15:00:09 2017 +0000
+++ b/main.cpp	Tue Sep 12 15:07:38 2017 +0000
@@ -1,7 +1,9 @@
 #include "mbed.h"
 #include "MODSERIAL.h"
 
-DigitalOut myled(LED_GREEN);
+DigitalOut ledG(LED_GREEN);
+DigitalOut ledR(LED_RED);
+DigitalOut ledB(LED_BLUE);
 MODSERIAL pc(USBTX, USBRX);
 
 int main()
@@ -10,9 +12,13 @@
     pc.baud(115200);
     pc.printf("Hello World!\r\n");
     
+    ledR = true;
+    ledB = true;
+    
     while (true) {
-        pc.putc(pc.getc());
-        myled = !myled; // toggle a led
+        int keyPress = pc.getc();
+        pc.putc(keyPress);
+        ledG = !ledG; // toggle a led
         
     }
 }