Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Revision 0:a82e8b118dfc, committed 2015-03-16
- Comitter:
- trivla
- Date:
- Mon Mar 16 15:28:23 2015 +0000
- Commit message:
- ff
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 Mar 16 15:28:23 2015 +0000 @@ -0,0 +1,38 @@ +#include "mbed.h" + + +BusOut lb(P1_13,P1_12,P1_7,P1_6,P1_4,P1_3,P1_1,P1_0,LED4,LED3,LED2,LED1); + + +DigitalIn sw4(P1_16); +int prevSW4=0; + +int CheckButton(); + +void OneRunLightStep(); +int main() +{ + while(1) + { + if( CheckButton() ) + OneRunLightStep(); + } +} + +int CheckButton() +{ + int ret=0; + if( prevSW4==0 && sw4==1) + ret=1; + prevSW4 = sw4==1; + return ret; +} + +void OneRunLightStep() +{ + if(lb==0) + lb=1; + else + lb = lb << 1; + +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Mar 16 15:28:23 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5 \ No newline at end of file