Proyecto Nivel, Edgar Ochoa, Erik Garcia

Dependencies:   MMA8451Q mbed

main.cpp

Committer:
through
Date:
2016-02-10
Revision:
5:8fcc1b94a287
Parent:
4:968d1e655757
Child:
7:c6894362b51d
Child:
12:c774b77e3f8e

File content as of revision 5:8fcc1b94a287:

#include "mbed.h"
#include "MMA8451Q.h" 
MMA8451Q acc(PTE25, PTE24);
PwmOut r(LED_RED);
PwmOut g(LED_GREEN);
PwmOut b(LED_BLUE);

Serial pc(USBTX,USBRX);
int16_t data[3];
int main() {
    
    pc.baud(9600); //velocidad serial//
    pc.format(8,SerialBase::None ,1) ;
    pc.putc(65);
    
    while(1) {
        
        acc.getAccAllAxis(data);       
        
        r = 1.0 - abs(data[0]/16500.0);
        g = 1.0 - abs(data[1]/16500.0);
        b = 1.0 - abs(data[2]/16500.0);
        
    
        pc.printf("%d,%d,%d,\n",data[0],data[1],data[2]);
        
        wait(0.4);
        
     }
        
    }


//Hola Mundo!!! jajajaja
//otro cambio
//pues no he cambiado nada pero hay vamos jaja
//ya llegué mundo, atte:erik

//sigo cambiando el programa ;)