Simple program to use the debouncing library
Dependencies: DebouncedIn mbed
Fork of DebouncedIn_HelloWorld by
main.cpp@2:b3d5973afde7, 2016-05-24 (annotated)
- Committer:
- janhavi
- Date:
- Tue May 24 09:04:14 2016 +0000
- Revision:
- 2:b3d5973afde7
- Parent:
- 1:7e4accb72e06
Simple program to demonstrate debouncing library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chris | 0:672241227e0d | 1 | #include "mbed.h" |
chris | 0:672241227e0d | 2 | #include "DebouncedIn.h" |
chris | 0:672241227e0d | 3 | |
chris | 0:672241227e0d | 4 | |
chris | 0:672241227e0d | 5 | DigitalOut led(LED1); |
janhavi | 1:7e4accb72e06 | 6 | DebouncedIn button(PTC9); |
chris | 0:672241227e0d | 7 | |
chris | 0:672241227e0d | 8 | int main() { |
chris | 0:672241227e0d | 9 | |
chris | 0:672241227e0d | 10 | while(1) { |
chris | 0:672241227e0d | 11 | if (button.rising()) { |
chris | 0:672241227e0d | 12 | led = !led; |
chris | 0:672241227e0d | 13 | } |
chris | 0:672241227e0d | 14 | } |
chris | 0:672241227e0d | 15 | |
chris | 0:672241227e0d | 16 | } |