echo characters typed on USB debug port

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
mfiore
Date:
Wed Dec 02 18:08:19 2015 +0000
Parent:
0:279c532226c8
Commit message:
blink RSSI LED on micro UDK and D3 led on UDK2

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 279c532226c8 -r 43abfdd0709b main.cpp
--- a/main.cpp	Wed Dec 02 16:11:54 2015 +0000
+++ b/main.cpp	Wed Dec 02 18:08:19 2015 +0000
@@ -1,10 +1,22 @@
 // this program echos on the USB debug port
+// it also blinks the RSSI LED on the micro UDK and the D3 LED on the UDK2
 
 #include "mbed.h"
 
+DigitalOut uled(XBEE_RSSI);     // RSSI LED on micro UDK
+DigitalOut led(LED1);           // D3 LED on UDK2
+
+Ticker tick;
+void tock(void) {
+    uled = !uled;
+    led = !led;
+}
+
 int main() {
     Serial usb(USBTX, USBRX);
     
+    tick.attach(&tock, 0.5);
+    
     // change the following value to change the baud rate
     usb.baud(115200);