Priliminary
Dependencies: DS1307 MAX17048 MODSERIAL SSD1308_128x64_I2C WatchDog mbed-rpc mbed
Fork of ECGAFE_copy by
Diff: DebouncedIn.h
- Revision:
- 0:ee0649a9025a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DebouncedIn.h Wed Sep 30 11:30:56 2015 +0000 @@ -0,0 +1,31 @@ +#include "mbed.h" + + class DebouncedIn { + public: + DebouncedIn(PinName in); + + int read (void); + operator int(); + + int releasing(void); + int pressing(void); + int pressed(void); + + private : + // objects + DigitalIn _in; + Ticker _ticker; + + // function to take a sample, and update flags + void _sample(void); + + // counters and flags + int _samples; + int _output; + int _output_last; + int _releasing_flag; + int _pressing_flag; + int _press_counter; + + }; + \ No newline at end of file