Projeto teste do Programa de integracao com biblioteca SGAM_MDW !! Aqui visa um usuario que usa o projeto implementado para a placa NUCLEO F429ZI

Dependencies:   sgam_mdw sgam_mdw_NUCLEOF429ZI_impl Cayenne-LPP

main.cpp

Committer:
AndersonIctus
Date:
2019-06-23
Revision:
12:2109a8bc8848
Parent:
10:cb7a807b5225
Child:
14:8ec6bdff6f67

File content as of revision 12:2109a8bc8848:

// #define DEBUG_SGAM

#include "mbed.h"
#include "sgam_mdw.h"

#include "ControlImpl.h"
#include "Gyroscope.h"

ControlImpl ctrl;

#define D_LOG(args...)   printf(args) 

int main() {
    D_LOG("=============== INICIO ===============\r\n");

    Control* control = ctrl.getControler();
    control->initialize();

    int count = 0;

    Sensor<float>* temp = (Sensor<float>*) control->getSensor("Temperature");
    // Sensor<GyroscopeData>* gyro = (Sensor<GyroscopeData>*) control->getSensor("Gyroscope");
    
    while( count++ < 10) {
        float* f = temp->getValue();
        D_LOG("Temperatura => %f \r\n", *f);

        // GyroscopeData* data = gyro->getValue();
        // D_LOG("Gyro (X) => %d \r\n", data->gx);
        // D_LOG("Gyro (Y) => %d \r\n", data->gy);
        // D_LOG("Gyro (Z) => %d \r\n", data->gz);
        // D_LOG("***********************************\r\n");

        wait(1.5);
    }

    control->finalize();
    D_LOG("=============== FINAL ===============\r\n");
    return 1;
}