Communication between two serial ports and control direction of motor through the serial terminal.
Dependencies: C12832_lcd mbed-rtos mbed
DebouncedIn.h
- Committer:
- bhakti08
- Date:
- 2014-04-30
- Revision:
- 0:b8435cfc1bba
File content as of revision 0:b8435cfc1bba:
#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; };