![](/media/cache/profiles/53015ad3b6bbbf80a4d107e6ef603b1e.jpg.50x50_q85.jpg)
En este programa se presenta un PID con entrada y salida analogica
Diff: DebouncedIn.h
- Revision:
- 0:4ba2d502801f
diff -r 000000000000 -r 4ba2d502801f DebouncedIn.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DebouncedIn.h Wed Nov 13 02:55:38 2013 +0000 @@ -0,0 +1,32 @@ +#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; + + }; + +