implementação do sgam_mdw baseado na placa NUCLEO FZ429ZI para ser testada
Dependencies: MPU6050 Grove_temperature
ControlImpl.cpp@5:fa36c3288be8, 2019-06-22 (annotated)
- Committer:
- AndersonIctus
- Date:
- Sat Jun 22 12:00:33 2019 -0300
- Revision:
- 5:fa36c3288be8
- Parent:
- 3:f67352c85fd7
- Child:
- 6:806043bf1a2c
- incluindo as modificacoes para incluir as diferencas postas na lib sgam_mdw
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AndersonIctus | 1:f21c2f775f15 | 1 | #include "sgam_mdw.h" |
AndersonIctus | 3:f67352c85fd7 | 2 | #include "mbed.h" |
AndersonIctus | 3:f67352c85fd7 | 3 | |
AndersonIctus | 0:681d98ff3681 | 4 | #include "ControlImpl.h" |
AndersonIctus | 3:f67352c85fd7 | 5 | #include "Temperature.h" |
AndersonIctus | 5:fa36c3288be8 | 6 | #include "Gyroscope.h" |
AndersonIctus | 3:f67352c85fd7 | 7 | |
AndersonIctus | 3:f67352c85fd7 | 8 | I2C i2c(I2C_SDA, I2C_SCL); |
AndersonIctus | 3:f67352c85fd7 | 9 | |
AndersonIctus | 3:f67352c85fd7 | 10 | ControlImpl::ControlImpl(){ } |
AndersonIctus | 3:f67352c85fd7 | 11 | |
AndersonIctus | 3:f67352c85fd7 | 12 | ControlImpl::~ControlImpl() { |
AndersonIctus | 5:fa36c3288be8 | 13 | // temp->~Temperature(); |
AndersonIctus | 3:f67352c85fd7 | 14 | } |
AndersonIctus | 3:f67352c85fd7 | 15 | |
AndersonIctus | 1:f21c2f775f15 | 16 | void ControlImpl::initialize() { |
AndersonIctus | 3:f67352c85fd7 | 17 | // possiveis inicializacoes no sistema ! |
AndersonIctus | 3:f67352c85fd7 | 18 | LOG("Inicializando o Controler !\r\n"); |
AndersonIctus | 5:fa36c3288be8 | 19 | |
AndersonIctus | 5:fa36c3288be8 | 20 | // Incluindo os Sensores |
AndersonIctus | 5:fa36c3288be8 | 21 | includeSensor( (Sensor<void*>*) new Temperature(A1) ); |
AndersonIctus | 5:fa36c3288be8 | 22 | includeSensor( (Sensor<void*>*) new Gyroscope(i2c) ); |
AndersonIctus | 3:f67352c85fd7 | 23 | } |
AndersonIctus | 1:f21c2f775f15 | 24 | |
AndersonIctus | 3:f67352c85fd7 | 25 | void ControlImpl::finalize() { |
AndersonIctus | 5:fa36c3288be8 | 26 | // Finalizando os Sensores |
AndersonIctus | 3:f67352c85fd7 | 27 | } |
AndersonIctus | 1:f21c2f775f15 | 28 | |
AndersonIctus | 1:f21c2f775f15 | 29 | Control* ControlImpl::getControler() { |
AndersonIctus | 3:f67352c85fd7 | 30 | // metodo de instancia unica |
AndersonIctus | 1:f21c2f775f15 | 31 | return this; |
AndersonIctus | 1:f21c2f775f15 | 32 | } |