Lab02 example: drive LED1 by a pushbutton tied between D3 and GND Platform: FRDM-KL25z

Dependencies:   mbed

Fork of led_button by Istvan Cserny

Revision:
0:b5f81eb006d4
Child:
1:0df6e12ac40d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Oct 12 12:36:46 2015 +0000
@@ -0,0 +1,16 @@
+/* led_button - difital I/O example
+ * drive LED1 by a pushbutton tied between D3 and GND
+ */
+
+#include "mbed.h"
+ 
+DigitalIn mybutton(D3,PullUp);
+DigitalOut myled(LED_RED);
+ 
+int main()
+{
+    while (true) {
+        myled = mybutton; 
+        wait_ms(20);
+    }
+}
\ No newline at end of file