Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ConfigFile SDFileSystem mbed
Fork of LAURUS_program by
MPU6050.h
00001 #pragma once 00002 00003 const static int mpu_addr = 0xd0; 00004 typedef union { 00005 uint8_t reg[14]; 00006 struct { 00007 uint8_t acc_x_L; 00008 uint8_t acc_x_H; 00009 uint8_t acc_y_L; 00010 uint8_t acc_y_H; 00011 uint8_t acc_z_L; 00012 uint8_t acc_z_H; 00013 00014 uint8_t T_L; 00015 uint8_t T_H; 00016 00017 uint8_t gyro_x_L; 00018 uint8_t gyro_x_H; 00019 uint8_t gyro_y_L; 00020 uint8_t gyro_y_H; 00021 uint8_t gyro_z_L; 00022 uint8_t gyro_z_H; 00023 } byte; 00024 00025 struct { 00026 int16_t acc[3]; 00027 00028 int16_t T; 00029 00030 int16_t gyro[3]; 00031 } value; 00032 } MPU_DATA; 00033 00034 class MPU6050 { 00035 public: 00036 MPU6050(I2C* p_i2c); 00037 ~MPU6050(); 00038 00039 int init(); 00040 int read(); 00041 MPU_DATA data; 00042 void checker_set(int x){check = x;} 00043 int checker_get(){return check;} 00044 private: 00045 I2C* i2c; 00046 int check; 00047 };
Generated on Tue Jul 12 2022 22:15:02 by
1.7.2
