Led blinking in the other way: Blink the green LED by switching the LED_GREEN (PTB19) pin between output and input mode. In output mode the pin will sink, while in the input mode it will be in the tristate (high impedance) mode. Platform: RDM-KL25Z board

Dependencies:   mbed

Revision:
0:4e110b1c53fc
diff -r 000000000000 -r 4e110b1c53fc main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Oct 12 15:41:17 2015 +0000
@@ -0,0 +1,21 @@
+/** Ledblink the other way
+ * Blink the green LED by switching the LED_GREEN (PTB19) pin
+ * between output and input mode. In output mode the pin will sink,
+ * while in the input mode it will be in the tristate (high impedance) mode.
+ *
+ * Platform: RDM-KL25Z board
+ */
+
+#include "mbed.h"
+
+DigitalInOut myled(LED_GREEN);
+
+int main() {
+    while(1) {
+        myled.output();
+        myled = 0;
+        wait(0.2);
+        myled.input();
+        wait(0.2);
+    }
+}