using the i2c from yang's library i used nxp lpc1768

Dependencies:   LSM6DS3 mbed

main.cpp

Committer:
oreo329
Date:
2017-04-13
Revision:
0:ede57b616ea7

File content as of revision 0:ede57b616ea7:

#include "mbed.h"
#include "LSM6DS3.h"

Serial pc(USBTX, USBRX); // tx, rx
LSM6DS3 LSM6DS3(p28,p27);

int main() {
   
    LSM6DS3.begin();
    
    while(1)
    {
        //read Accel & Gyro
        LSM6DS3.readAccel();
        LSM6DS3.readGyro();
        
        //serial send Accel
        pc.printf("AccelerX[%f]\n",LSM6DS3.ax);
        pc.printf("AccelerY[%f]\n",LSM6DS3.ay);
        pc.printf("AccelerZ[%f]\n",LSM6DS3.az);
        
        //serial send Gyro
        pc.printf("GyroX[%f]\n",LSM6DS3.gx);
        pc.printf("GyroY[%f]\n",LSM6DS3.gy);
        pc.printf("GyroZ[%f]\n",LSM6DS3.gz);
        
    }
   
}