This is a debounced version of DigitalIn for Mechanical Switches. It is simplistic, and should be easy to use.
Diff: DebouncedIn.h
- Revision:
- 0:323110faffe5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DebouncedIn.h Fri Aug 16 17:49:32 2013 +0000 @@ -0,0 +1,18 @@ +#include "mbed.h" + + class DebouncedIn { + public: + DebouncedIn(PinName pin); + bool get(); + void CheckState(); + bool get_pin(); + + private : + // objects + DigitalIn _pin; + Ticker _poll; + + }; + + + \ No newline at end of file