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.
modulos/sistema/Sistema.h@0:b5316e9f3cb5, 2021-05-27 (annotated)
- Committer:
- cbiale
- Date:
- Thu May 27 02:32:03 2021 +0000
- Revision:
- 0:b5316e9f3cb5
Estado actual
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| cbiale | 0:b5316e9f3cb5 | 1 | #ifndef SISTEMA_H |
| cbiale | 0:b5316e9f3cb5 | 2 | #define SISTEMA_H |
| cbiale | 0:b5316e9f3cb5 | 3 | |
| cbiale | 0:b5316e9f3cb5 | 4 | #include "mbed.h" |
| cbiale | 0:b5316e9f3cb5 | 5 | #include "Tiempo.h" |
| cbiale | 0:b5316e9f3cb5 | 6 | #include "ControladorLuminosidad.h" |
| cbiale | 0:b5316e9f3cb5 | 7 | #include "ControladorTemperatura.h" |
| cbiale | 0:b5316e9f3cb5 | 8 | |
| cbiale | 0:b5316e9f3cb5 | 9 | class Sistema { |
| cbiale | 0:b5316e9f3cb5 | 10 | |
| cbiale | 0:b5316e9f3cb5 | 11 | public: |
| cbiale | 0:b5316e9f3cb5 | 12 | Sistema(Tiempo& tiempo, float minimaLuz, float maximaTemperatura, PinName const &pinLuz, PinName const &pinVentilador, |
| cbiale | 0:b5316e9f3cb5 | 13 | PinName const &pinLuminosidad, PinName const &pinTemperaturaHumedad, PinName const &pinSirena); |
| cbiale | 0:b5316e9f3cb5 | 14 | |
| cbiale | 0:b5316e9f3cb5 | 15 | void controlar(); |
| cbiale | 0:b5316e9f3cb5 | 16 | |
| cbiale | 0:b5316e9f3cb5 | 17 | private: |
| cbiale | 0:b5316e9f3cb5 | 18 | // temporizador y cola de mensajes |
| cbiale | 0:b5316e9f3cb5 | 19 | Ticker temporizador; |
| cbiale | 0:b5316e9f3cb5 | 20 | EventQueue cola; |
| cbiale | 0:b5316e9f3cb5 | 21 | // hilo para manejar eventos |
| cbiale | 0:b5316e9f3cb5 | 22 | Thread hiloEventos; |
| cbiale | 0:b5316e9f3cb5 | 23 | // cantidad de lecturas a realizar por los controladores |
| cbiale | 0:b5316e9f3cb5 | 24 | int const cantidadLecturas = 12; |
| cbiale | 0:b5316e9f3cb5 | 25 | // tiempo |
| cbiale | 0:b5316e9f3cb5 | 26 | Tiempo tiempo; |
| cbiale | 0:b5316e9f3cb5 | 27 | // controlador de luminosidad |
| cbiale | 0:b5316e9f3cb5 | 28 | ControladorLuminosidad controladorLuminosidad; |
| cbiale | 0:b5316e9f3cb5 | 29 | // controlador de temperatura |
| cbiale | 0:b5316e9f3cb5 | 30 | ControladorTemperatura controladorTemperatura; |
| cbiale | 0:b5316e9f3cb5 | 31 | }; |
| cbiale | 0:b5316e9f3cb5 | 32 | |
| cbiale | 0:b5316e9f3cb5 | 33 | #endif |