Stefan Hutter
/
kurzSchreibweise
Hutter_Kleine_schnelle_spielerei
Revision 0:4e21bc422e8d, committed 2019-11-25
- Comitter:
- Hutzi
- Date:
- Mon Nov 25 18:20:49 2019 +0000
- Child:
- 1:19efdb4573f0
- Commit message:
- Kleine Spielerei_Hutter
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 Nov 25 18:20:49 2019 +0000 @@ -0,0 +1,46 @@ +#include "mbed.h" + +BusOut led(LED1,LED2,LED3,LED4); +BusIn jst (p12,p13,p14,p15,p16); + + +int main() { + + led = 0x0; + + + + while (1) { + + if(jst & 0x2){ + + led = 0xF; + + for(int i=0;i<4;i++){ + + led = led<<1; + + wait_ms(200); + } + } + + if(jst & 0x10){ + + led = 0x0; + + for(int i=0;i<4;i++){ + + led = (led>>1) | 0x8; + + wait_ms(100); + } + } + + + + + + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Nov 25 18:20:49 2019 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/a330f0fddbec \ No newline at end of file