Asignación de valores controlador PID sencillo.
Fork of controlPID by
DebouncedIn.h@2:434bb36fa59f, 2013-10-18 (annotated)
- Committer:
- jmcallef
- Date:
- Fri Oct 18 05:12:02 2013 +0000
- Revision:
- 2:434bb36fa59f
- Parent:
- 0:672241227e0d
Asignar valores control PID sencillo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chris | 0:672241227e0d | 1 | #include "mbed.h" |
chris | 0:672241227e0d | 2 | |
chris | 0:672241227e0d | 3 | class DebouncedIn { |
chris | 0:672241227e0d | 4 | public: |
chris | 0:672241227e0d | 5 | DebouncedIn(PinName in); |
chris | 0:672241227e0d | 6 | |
chris | 0:672241227e0d | 7 | int read (void); |
chris | 0:672241227e0d | 8 | operator int(); |
chris | 0:672241227e0d | 9 | |
chris | 0:672241227e0d | 10 | int rising(void); |
chris | 0:672241227e0d | 11 | int falling(void); |
chris | 0:672241227e0d | 12 | int steady(void); |
chris | 0:672241227e0d | 13 | |
chris | 0:672241227e0d | 14 | private : |
chris | 0:672241227e0d | 15 | // objects |
chris | 0:672241227e0d | 16 | DigitalIn _in; |
chris | 0:672241227e0d | 17 | Ticker _ticker; |
chris | 0:672241227e0d | 18 | |
chris | 0:672241227e0d | 19 | // function to take a sample, and update flags |
chris | 0:672241227e0d | 20 | void _sample(void); |
chris | 0:672241227e0d | 21 | |
chris | 0:672241227e0d | 22 | // counters and flags |
chris | 0:672241227e0d | 23 | int _samples; |
chris | 0:672241227e0d | 24 | int _output; |
chris | 0:672241227e0d | 25 | int _output_last; |
chris | 0:672241227e0d | 26 | int _rising_flag; |
chris | 0:672241227e0d | 27 | int _falling_flag; |
chris | 0:672241227e0d | 28 | int _state_counter; |
chris | 0:672241227e0d | 29 | |
chris | 0:672241227e0d | 30 | }; |
chris | 0:672241227e0d | 31 |