![](/media/cache/profiles/b6c8cf4c587f2ead0c08955ee6e2502b.50x50_q85.jpg)
An updated and more polished version of the earlier TeaBasic. This is now finished and works like a treat.
DebouncedIn.h
- Committer:
- Eggotape
- Date:
- 2011-06-29
- Revision:
- 0:36264f703f1c
File content as of revision 0:36264f703f1c:
#include "mbed.h" class DebouncedIn { public: DebouncedIn(PinName in); int read (void); operator int(); int rising(void); int falling(void); int steady(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 _rising_flag; int _falling_flag; int _state_counter; };