Tedd OKANO
/
_sample_self_reset
Diff: main.cpp
- Revision:
- 0:57ee3dae2e7f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Mar 30 03:56:47 2011 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" + +BusOut led( LED1, LED2, LED3, LED4 ); +DigitalInOut io( p5 ); + +int main() { + io.mode( PullUp ); + io.input(); + io = 0; + char count = 4; + + led = 0xF; wait( 0.25 ); led = 0x0; wait( 0.25 ); + led = 0xF; wait( 0.25 ); led = 0x0; wait( 0.25 ); + + while (1) { + led = 0xF0 >> count; + if ( !count-- ) + io.output(); + wait( 1 ); + } +}