Simon Ford / Mbed 2 deprecated SerialInterrupt

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
simon
Date:
Mon Nov 16 17:24:55 2009 +0000
Commit message:

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 011dac18d106 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Nov 16 17:24:55 2009 +0000
@@ -0,0 +1,20 @@
+// Example using Serial rx interrupt, sford
+
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+DigitalOut myled2(LED2);
+Serial pc(USBTX, USBRX);
+
+void foo() {
+    myled = !myled;
+    pc.putc(pc.getc() + 1);
+}
+
+int main() {
+    pc.attach(&foo);
+    while(1) {
+        myled2 = !myled2;
+        wait(0.25);
+    }
+}
diff -r 000000000000 -r 011dac18d106 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Nov 16 17:24:55 2009 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/d1a9de3f4fe0