Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: ElecPneuShifter_4 tarea1 tarea_miercoles Rampa ... more
DebouncedIn.h
- Committer:
- WarwickRacing
- Date:
- 2010-11-28
- Revision:
- 0:8992c13bbb9b
File content as of revision 0:8992c13bbb9b:
#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;
};