code sample for workshop

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
okano
Date:
Mon Apr 13 07:38:02 2015 +0000
Commit message:
initial version

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Apr 13 07:38:02 2015 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+
+DigitalOut  myled( LED1 );
+DigitalIn   input( p5 );
+Serial      ser( USBTX, USBRX );
+
+int main() {
+    input.mode( PullUp );
+    
+    while(1) {
+        myled = !input;
+        ser.printf( "switch is %s\r\n", input ? "OFF" : "ON" );
+        wait( 0.5 );
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Apr 13 07:38:02 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/487b796308b0
\ No newline at end of file