![](/media/cache/profiles/bd1ce36d68a5c2bea97fe45863673b20.jpg.50x50_q85.jpg)
programa para hacer control PID simple
Fork of DebouncedIn_HelloWorld by
este programa permite hacer control PID simple, se configuran 4 parametros como: SETPOINT KP KI KD
USA 4 PULSADORES ASI AUMENTAR: aumenta el parametro seleccionado por menu DISMINUIR : disminuye el parametro seleccionado por menu MENU: cambia de menu o campo de ingreso ENTER: confirma el menu y se sale
DebouncedIn.h@0:672241227e0d, 2009-11-27 (annotated)
- Committer:
- chris
- Date:
- Fri Nov 27 16:05:32 2009 +0000
- Revision:
- 0:672241227e0d
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 |