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, committed 2015-10-12
- Comitter:
- icserny
- Date:
- Mon Oct 12 15:41:17 2015 +0000
- Commit message:
- First 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 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); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Oct 12 15:41:17 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/34e6b704fe68 \ No newline at end of file