![](/media/cache/profiles/c4661f6669f5f35823f39acb6d6be725.jpg.50x50_q85.jpg)
2 ports read ang
Fork of VOLTIMETRO1 by
DebouncedIn.h
- Committer:
- kolive360
- Date:
- 2017-11-30
- Revision:
- 3:61fd3a58c5bf
- Parent:
- 0:4676a90107ca
File content as of revision 3:61fd3a58c5bf:
#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; };