Added for gyro and testing

main.cpp

Committer:
jahutchi
Date:
2019-07-03
Revision:
12:6efce6d008f8
Child:
13:d66766523196

File content as of revision 12:6efce6d008f8:

#include <MPU6050.h>
#include "IMU6050.h"
MPU6050 IMU(D14, D15);
Serial pc(USBTX, USBRX, 57600);                                     //Serial Monitor
float dataA[3];
float* data = dataA;
int main()
{
    IMU.setGyroRange(MPU6050_GYRO_RANGE_500);
    pc.printf("Imu test connections %d\r\n", IMU.testConnection());
    while(1){
        
        IMU.getGyro(data);
        pc.printf("x: %f, y: %f, z: %f\r\n", dataA[0]*180/3.14, dataA[1]*180/3.14, dataA[2]*180/3.14);
        wait(.2);
    }
}