Blink the onboard LED, and Print it's status in Serial

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Revision:
66:dd8d05fd9f8b
Parent:
29:0b58d21e87d6
--- a/main.cpp	Wed May 02 06:30:02 2018 +0100
+++ b/main.cpp	Wed May 09 16:23:06 2018 +0000
@@ -1,11 +1,13 @@
 #include "mbed.h"
 
 DigitalOut led1(LED1);
+Serial pc(USBTX, USBRX); // tx, rx
 
 // main() runs in its own thread in the OS
 int main() {
     while (true) {
         led1 = !led1;
+        pc.printf("%sLed %s\n",(led1?"":"\t"),(led1?"ON":"OFF"));
         wait(0.5);
     }
 }