Alexander Leber
/
m0_TasterCounter10V2
DigitalIO Aufgabe 14
Revision 0:369891f9a34f, committed 2016-01-21
- Comitter:
- DoTTi
- Date:
- Thu Jan 21 16:26:59 2016 +0000
- Commit message:
- DigitalIO Aufgabe 14
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 369891f9a34f main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Jan 21 16:26:59 2016 +0000 @@ -0,0 +1,31 @@ +#include "mbed.h" + +DigitalOut myled(LED1); +DigitalIn taster(P0_10); + +int main() +{ +int counter=-1; +int tasteralt=1; +int tasterneu; + + //taster.mode(PullUp); + wait(.001); + while(1) { + tasterneu = taster; + if ((tasterneu==0) && (tasteralt==1)) + { + counter++; + } + if(counter ==10) + { + myled=1; + wait(1); + counter=0; + } + else{ + myled=0; + } + tasteralt = tasterneu; + } +} \ No newline at end of file
diff -r 000000000000 -r 369891f9a34f mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Jan 21 16:26:59 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6f327212ef96 \ No newline at end of file