Takuo WATANABE
/
DebounceIn_Demo
A demo program for DebounceIn
Revision 0:3588368c5b3c, committed 2015-12-20
- Comitter:
- takuo
- Date:
- Sun Dec 20 12:05:24 2015 +0000
- Commit message:
- Initial commit
Changed in this revision
diff -r 000000000000 -r 3588368c5b3c DebounceIn.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DebounceIn.lib Sun Dec 20 12:05:24 2015 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/takuo/code/DebounceIn/#e43521d55082
diff -r 000000000000 -r 3588368c5b3c main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Dec 20 12:05:24 2015 +0000 @@ -0,0 +1,21 @@ +/** A demo program for DebounceIn + * Takuo WATANABE + * http://mbed.org/users/takuo/code/DebounceIn/ + */ + +#include "mbed.h" +#include "DebounceIn.h" + +int nrise = 0, nfall = 0; +void rise() { nrise++; } +void fall() { nfall++; } + +int main() { + DebounceIn button(p14); + button.rise(rise); + button.fall(fall); + while (true) { + printf("nrise=%d, nfall=%d\n", nrise, nfall); + wait(1); + } +}
diff -r 000000000000 -r 3588368c5b3c mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Dec 20 12:05:24 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4336505e4b1c \ No newline at end of file