Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 BusOut          led( LED1, LED2, LED3, LED4 );
00004 DigitalInOut    io( p5 );
00005 
00006 int main() {
00007     io.mode( PullUp );
00008     io.input();
00009     io   = 0;
00010     char    count   = 4;
00011 
00012     led = 0xF; wait( 0.25 ); led = 0x0; wait( 0.25 );
00013     led = 0xF; wait( 0.25 ); led = 0x0; wait( 0.25 );
00014 
00015     while (1) {
00016         led = 0xF0 >> count;
00017         if ( !count-- )
00018             io.output();
00019         wait( 1 );
00020     }
00021 }