Proyecto Nivel, Edgar Ochoa, Erik Garcia

Dependencies:   MMA8451Q mbed

main.cpp

Committer:
verden32
Date:
2016-02-12
Revision:
25:2d2f8736f147
Parent:
22:de1ab79df237

File content as of revision 25:2d2f8736f147:

#include "adcBasic.h"
float x,y,z;
PwmOut r(LED_RED);
PwmOut g(LED_GREEN);
PwmOut b(LED_BLUE);
Serial pc(USBTX,USBRX);
int16_t data[3];
#include "Ochoa.h"
#include "versionerik.h"
#include "mbed.h"
#include "MMA8451Q.h"
MMA8451Q acc(PTE25, PTE24);





int main() {
    
    pc.baud(9600); //velocidad serial//
    pc.format(8,SerialBase::None ,1) ;
    pc.putc(65);
    mensaje();
    while(1) {
        
        acc.getAccAllAxis(data);       
    
        z = 1.0 - abs(data[0]/16500.0);
        y = 1.0 - abs(data[1]/16500.0);
        x = 1.0 - abs(data[2]/16500.0);
    erik_nivel();
    Mensajes();
        pc.printf("%d,%d,%d,\n",data[0],data[1],data[2]);
        
        wait(0.4);
        
     }
        
    }


//Hola Mundo!!! jajajaja
//otro cambio