1#ifndef GYROACELEMETER_GY521_H
2#define GYROACELEMETER_GY521_H
13 explicit MPU6050 (uint8_t i2cAddress = 0x68, QObject *parent =
nullptr);
14 void readAllSensors(
float &ax,
float &ay,
float &az,
float &gx,
float &gy,
float &gz);
17 bool writeByte(uint8_t reg, uint8_t value);
18 bool readBytes(uint8_t reg, uint8_t *buffer,
size_t length);
27 float gyroOffset[3] = {0, 0, 0};
28 float accelOffset[3] = {0, 0, 0};
30 static constexpr uint8_t PWR_MGMT_1 = 0x6B;
31 static constexpr uint8_t ACCEL_XOUT_H = 0x3B;
32 static constexpr uint8_t GYRO_XOUT_H = 0x43;
33 static constexpr uint8_t INT_ENABLE = 0x38;
34 static constexpr uint8_t INT_PIN_CFG = 0x37;
35 static constexpr float ACCEL_FS_SEL_2G = 16384.0;
36 static constexpr float GYRO_FS_SEL_250DEG = 131.0;
38 bool initializeMPU6050();
39 void applyCalibration(
float &ax,
float &ay,
float &az,
float &gx,
float &gy,
float &gz);
Definition i2c_device.h:8
bool writeByte(uint8_t reg, uint8_t value)
Definition gyroacelemeter_gy521.cpp:41
bool readBytes(uint8_t reg, uint8_t *buffer, size_t length)
Definition gyroacelemeter_gy521.cpp:46
void calibrateGyro()
Definition gyroacelemeter_gy521.cpp:69
void readAllSensors(float &ax, float &ay, float &az, float &gx, float &gy, float &gz)
Definition gyroacelemeter_gy521.cpp:55
MPU6050()
Definition MPU6050.cpp:10
void readAllMPU6050Reg()
Definition gyroacelemeter_gy521.cpp:117
void calibrateAccel()
Definition gyroacelemeter_gy521.cpp:88