a
main.cpp
- Committer:
- isagmz
- Date:
- 2019-07-09
- Revision:
- 16:caf587f09e34
- Parent:
- 15:b7cac36c4cce
File content as of revision 16:caf587f09e34:
#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); //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()); pc.printf("%f\r\n", IMU.gyro_x()); // printf("%f\r\n ", IMU.yaw()); } }