Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: ElecPneuShifter_4 tarea1 tarea_miercoles Rampa ... more
DebouncedIn.h@0:8992c13bbb9b, 2010-11-28 (annotated)
- Committer:
- WarwickRacing
- Date:
- Sun Nov 28 14:19:52 2010 +0000
- Revision:
- 0:8992c13bbb9b
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| WarwickRacing | 0:8992c13bbb9b | 1 | #include "mbed.h" |
| WarwickRacing | 0:8992c13bbb9b | 2 | |
| WarwickRacing | 0:8992c13bbb9b | 3 | class DebouncedIn { |
| WarwickRacing | 0:8992c13bbb9b | 4 | public: |
| WarwickRacing | 0:8992c13bbb9b | 5 | DebouncedIn(PinName in); |
| WarwickRacing | 0:8992c13bbb9b | 6 | |
| WarwickRacing | 0:8992c13bbb9b | 7 | int read (void); |
| WarwickRacing | 0:8992c13bbb9b | 8 | operator int(); |
| WarwickRacing | 0:8992c13bbb9b | 9 | |
| WarwickRacing | 0:8992c13bbb9b | 10 | int rising(void); |
| WarwickRacing | 0:8992c13bbb9b | 11 | int falling(void); |
| WarwickRacing | 0:8992c13bbb9b | 12 | int steady(void); |
| WarwickRacing | 0:8992c13bbb9b | 13 | |
| WarwickRacing | 0:8992c13bbb9b | 14 | private : |
| WarwickRacing | 0:8992c13bbb9b | 15 | // objects |
| WarwickRacing | 0:8992c13bbb9b | 16 | DigitalIn _in; |
| WarwickRacing | 0:8992c13bbb9b | 17 | Ticker _ticker; |
| WarwickRacing | 0:8992c13bbb9b | 18 | |
| WarwickRacing | 0:8992c13bbb9b | 19 | // function to take a sample, and update flags |
| WarwickRacing | 0:8992c13bbb9b | 20 | void _sample(void); |
| WarwickRacing | 0:8992c13bbb9b | 21 | |
| WarwickRacing | 0:8992c13bbb9b | 22 | // counters and flags |
| WarwickRacing | 0:8992c13bbb9b | 23 | int _samples; |
| WarwickRacing | 0:8992c13bbb9b | 24 | int _output; |
| WarwickRacing | 0:8992c13bbb9b | 25 | int _output_last; |
| WarwickRacing | 0:8992c13bbb9b | 26 | int _rising_flag; |
| WarwickRacing | 0:8992c13bbb9b | 27 | int _falling_flag; |
| WarwickRacing | 0:8992c13bbb9b | 28 | int _state_counter; |
| WarwickRacing | 0:8992c13bbb9b | 29 | }; |