Header file and functions

main.cpp

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

File content as of revision 13:d66766523196:

#include <MPU6050.h>
#include "IMUWheelchair.h"
MPU6050 IMU(D14, D15);
Serial pc(USBTX, USBRX, 57600);                                     //Serial Monitor
float dataGyro[3];
float *dataG = dataGyro;

float dataYaw[3];
float *dataY = dataYaw;

int main()
{
    IMU.setGyroRange(MPU6050_GYRO_RANGE_500);
    pc.printf("Imu test connections %d\r\n", IMU.testConnection());
    while(1){
        
        IMU.getGyro(dataG);
       // pc.printf("x: %f, y: %f, z: %f\r\n", dataGyro[0]*180/3.14, dataGyro[1]*180/3.14, dataGyro[2]*180/3.14);
        wait(.2);
        
        IMU.getAcceleroAngle(dataY);
        pc.printf("x: %f, y: %f, z: %f\r\n", dataG[0], dataG[1], dataG[2]);
    }
}