Serial test program

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
lelect
Date:
Sun May 11 09:02:57 2014 +0000
Commit message:
SerialInterrupt learn; Interrupt and sleep no relation

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r b3252151233e main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun May 11 09:02:57 2014 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+Serial pc(USBTX, USBRX); // tx, rx
+BusOut leds(LED1,LED2,LED3,LED4);
+
+void pc_rx ()
+{
+    int buff=pc.getc();
+    leds=buff;
+}
+int main()
+{
+    pc.baud(9600);
+    pc.printf("HelloWorld!");
+    pc.attach(&pc_rx,Serial::RxIrq);
+    while(1) {
+        sleep();
+        pc.printf("HelloWorld!");
+    };
+}
\ No newline at end of file
diff -r 000000000000 -r b3252151233e mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun May 11 09:02:57 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8a40adfe8776
\ No newline at end of file