Tadao Iida
/
LED_Control3
Revision 0:99572ba60612, committed 2010-09-19
- Comitter:
- sunifu
- Date:
- Sun Sep 19 08:19:46 2010 +0000
- Commit message:
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 |
diff -r 000000000000 -r 99572ba60612 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Sep 19 08:19:46 2010 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" + +BusOut myleds(LED1, LED2, LED3, LED4); + +// Bit Come and Go +int main() { + int i = 0 ; + int stat = 0 ; + + myleds = 1 ; + wait(0.5) ; + + while(1) { + if ( stat == 0 ){ + myleds = myleds << 1; + wait(0.5); + if ( myleds == 8 ) + stat = 1; + }else{ + myleds = myleds >> 1; + wait(0.5); + if ( myleds == 1 ) + stat = 0; + } + } +}
diff -r 000000000000 -r 99572ba60612 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Sep 19 08:19:46 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e