ARM Mbed with switch and led game.
Dependencies: mbed
Revision 0:0ae90b4ea12e, committed 2018-05-16
- Comitter:
- mrbhatter
- Date:
- Wed May 16 07:49:27 2018 +0000
- Commit message:
- Switch Game Number with Switch Stop and LED
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 0ae90b4ea12e main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed May 16 07:49:27 2018 +0000 @@ -0,0 +1,32 @@ +#include "mbed.h" + +DigitalOut myled(LED_GREEN); +DigitalIn s(PTC9); +Serial pc(USBTX, USBRX); + +int c; +float t=1.0f; +int main() +{ + + while (1) + { + for(c=0;c<=100;c++) + { + pc.printf("%d \n", c); + if(s==0 && c%10==0) + { + myled=0; + t=t-0.3; + wait(4); + + } + else + { + myled=1; + wait(t); + + } + } + } +} \ No newline at end of file
diff -r 000000000000 -r 0ae90b4ea12e mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed May 16 07:49:27 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7c328cabac7e \ No newline at end of file