Added for gyro and testing

main.cpp

Committer:
sepham
Date:
2019-07-04
Revision:
14:365c1c1bf6ee
Parent:
13:d66766523196

File content as of revision 14:365c1c1bf6ee:

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

int main()
{
    t.start();
    //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.gyro_x();
       // IMU.getAcceleroAngle(dataY);
       // pc.printf("x: %f, y: %f, z: %f\r\n", dataG[0]*180/3.1415926 + .79, dataG[1], dataG[2]);
       // printf("%f, %f, %f\n", IMU.gyro_x(), IMU.gyro_y(), IMU.gyro_z()); 
       // printf("%f\r\n ", IMU.accel_x());
      
       IMU.yaw();
       // printf("%f\r\n ", IMU.yaw());
    }
}