![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Control PID para una planta RC (control de carga del capacitor), los parámetros se ingresan por medio de un Encoder y se visualizan en una pantalla LCD 16x2.
DebouncedIn.h@0:dd68101b1b99, 2013-12-13 (annotated)
- Committer:
- Wilmar87
- Date:
- Fri Dec 13 04:14:14 2013 +0000
- Revision:
- 0:dd68101b1b99
yes;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Wilmar87 | 0:dd68101b1b99 | 1 | #include "mbed.h" |
Wilmar87 | 0:dd68101b1b99 | 2 | |
Wilmar87 | 0:dd68101b1b99 | 3 | class DebouncedIn { |
Wilmar87 | 0:dd68101b1b99 | 4 | public: |
Wilmar87 | 0:dd68101b1b99 | 5 | DebouncedIn(PinName in); |
Wilmar87 | 0:dd68101b1b99 | 6 | |
Wilmar87 | 0:dd68101b1b99 | 7 | int read (void); |
Wilmar87 | 0:dd68101b1b99 | 8 | operator int(); |
Wilmar87 | 0:dd68101b1b99 | 9 | |
Wilmar87 | 0:dd68101b1b99 | 10 | int rising(void); |
Wilmar87 | 0:dd68101b1b99 | 11 | int falling(void); |
Wilmar87 | 0:dd68101b1b99 | 12 | int steady(void); |
Wilmar87 | 0:dd68101b1b99 | 13 | |
Wilmar87 | 0:dd68101b1b99 | 14 | private : |
Wilmar87 | 0:dd68101b1b99 | 15 | // objects |
Wilmar87 | 0:dd68101b1b99 | 16 | DigitalIn _in; |
Wilmar87 | 0:dd68101b1b99 | 17 | Ticker _ticker; |
Wilmar87 | 0:dd68101b1b99 | 18 | |
Wilmar87 | 0:dd68101b1b99 | 19 | // function to take a sample, and update flags |
Wilmar87 | 0:dd68101b1b99 | 20 | void _sample(void); |
Wilmar87 | 0:dd68101b1b99 | 21 | |
Wilmar87 | 0:dd68101b1b99 | 22 | // counters and flags |
Wilmar87 | 0:dd68101b1b99 | 23 | int _samples; |
Wilmar87 | 0:dd68101b1b99 | 24 | int _output; |
Wilmar87 | 0:dd68101b1b99 | 25 | int _output_last; |
Wilmar87 | 0:dd68101b1b99 | 26 | int _rising_flag; |
Wilmar87 | 0:dd68101b1b99 | 27 | int _falling_flag; |
Wilmar87 | 0:dd68101b1b99 | 28 | int _state_counter; |
Wilmar87 | 0:dd68101b1b99 | 29 | |
Wilmar87 | 0:dd68101b1b99 | 30 | }; |
Wilmar87 | 0:dd68101b1b99 | 31 |