Anesa Drakovac Emir Mujačić

Dependencies:   MMA8451Q mbed

main.cpp

Committer:
tim007
Date:
2014-05-15
Revision:
0:6427c1b90439

File content as of revision 0:6427c1b90439:

#include "mbed.h"
#include "MMA8451Q.h"

Serial pc(USBTX, USBRX);

#define MMA8451_I2C_ADDRESS (0x1d<<1)
 
MMA8451Q acc(PTE25, PTE24, MMA8451_I2C_ADDRESS);
Ticker t;

void ispisi()
{
  pc.printf("Koordinate X = %f; Y = %f; Z = %f\n",acc.getAccX(), acc.getAccY(), acc.getAccZ());
}

int main()
{
    t.attach(ispisi,1);
    while(1)
    {   
    }
}