code sample for workshop

Dependencies:   mbed

Revision:
0:228cf6908a24
--- /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 );
+    }
+}