Martin Werluschnig
/
Umschalt_Lauflicht
Umschalt_Lauflicht
Revision 0:26a539991e86, committed 2018-11-15
- Comitter:
- martwerl
- Date:
- Thu Nov 15 18:25:45 2018 +0000
- Commit message:
- Umschalt_Lauflicht
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 26a539991e86 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Nov 15 18:25:45 2018 +0000 @@ -0,0 +1,30 @@ +//Umschalt_Lauflicht +#include "mbed.h" + +DigitalIn diUp(p15); +DigitalIn diDown(p12); +BusOut doLeds(LED1,LED2,LED3,LED4); + +int main() +{ +doLeds = 0; + while(1) + { + if (diDown) + { + if (doLeds <= 0) + doLeds = 8; + else + doLeds = doLeds>>1; // um eine position nach rechts schieben + } + else if (diUp) + { + if (doLeds <= 0) + doLeds = 1; + else + doLeds = doLeds<<1; // um eine position nach links schieben + } + if (doLeds != 0) + wait(0.5); + } +}
diff -r 000000000000 -r 26a539991e86 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 15 18:25:45 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7130f322cb7e \ No newline at end of file