Test with FXOS8700CQ and LSM6DS3 in K64F

Dependencies:   FXOS8700CQ LSM6DS3 mbed

Fork of I2C_LSM6DS3 by seungjae oh

main.cpp

Committer:
oreo329
Date:
2017-04-13
Revision:
0:ede57b616ea7
Child:
1:83eb35fff8a9

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);
        
    }
   
}