13#include "pico/stdlib.h"
15#include "config_MPU6050.h"
40 uint8_t
INT_PIN_CFG = INT_LEVEL | LATCH_INT_EN | INT_RD_CLEAR;
108 float acceleration_factor{};
112 float temperature_gain = 1.0 / 340.0;
114 float temperature_offset = 36.53;
116 float accel_x_offset{};
118 float accel_y_offset{};
120 float accel_z_offset{};
122 float gyro_x_offset{};
124 float gyro_y_offset{};
126 float gyro_z_offset{};
146 void convert_raw_to_measure();
148 void read_FIFO_g_accel_raw_data();
150 void read_FIFO_accel_raw_data();
this is a C++ wrapper for the original pico SDK i2c master API
Definition hw_i2c.h:129
float get_MPU_temperature()
Get the MPU temperature object.
Definition mpu6050.cpp:183
struct_MPUData data
the set of measures from sensors
Definition mpu6050.h:167
MPU6050(HW_I2C_Master *master, struct_ConfigMPU6050 default_config)
Construct a new MPU6050 object.
Definition mpu6050.cpp:7
struct_I2CXferResult get_measures()
Get the raw data, fill the internal struct_RawData, converts raw data to real measures according to o...
Definition mpu6050.cpp:191
bool is_data_ready()
the flag that indicates if sensors data are ready
Definition mpu6050.cpp:206
struct_RawData raw
the set of raw data from sensors
Definition mpu6050.h:169
uint16_t get_FIFO_count()
Get the FIFO count object.
Definition mpu6050.cpp:199
void read_FIFO_all_raw_data()
read raw data from FIFO
Definition mpu6050.cpp:31
minimal set of MPU configuration data
Definition mpu6050.h:22
uint8_t SIGNAL_PATH_RESET
Reg 0x68: default no reset.
Definition mpu6050.h:44
uint8_t INT_ENABLE
Reg 0x38: INT each time a sensor register write occurs.
Definition mpu6050.h:42
uint16_t GYRO_FULL_SCALE_RANGE
Reg 0x1B: values in { 250, 500, 1000, 2000} DegreePerSecond.
Definition mpu6050.h:34
uint8_t ACCEL_FULL_SCALE_RANGE
Reg 0x1C:values in { 2, 4, 8, 16} G.
Definition mpu6050.h:36
uint8_t EXT_SYNC
Reg 0x1A: external synchronisation via FSYNC pin.
Definition mpu6050.h:30
uint8_t PWR_MGMT_1
Reg 0x6B:
Definition mpu6050.h:48
uint8_t FIFO_OP
Reg 0x6A: FIFO enable.
Definition mpu6050.h:46
uint8_t FIFO_SELECTED_SENSORS
Reg 0x23:
Definition mpu6050.h:38
uint8_t MPU_ADDR
MPU address, assuming AD0 pin is low otherwise = 0x69.
Definition mpu6050.h:24
uint8_t INT_PIN_CFG
Reg 0x37: Active LO, open drain, pulsed 50us, cleared any read operation.
Definition mpu6050.h:40
uint16_t SAMPLE_RATE
Reg 0x19: set sensors sample rate in Hz.
Definition mpu6050.h:26
uint16_t GYRO_OUT_RATE
Reg 0x1A: in Hz, depending on DLPF value.
Definition mpu6050.h:32
uint8_t DLPF_BW
Reg 0x1A: Digital Low-Pass Filter bandwidth. values in { 250, 200, 100, 50, 20, 10,...
Definition mpu6050.h:28
this data structure collects result when an I2C transfer is done. It gives a more verbose error descr...
Definition hw_i2c.h:33
measured sensor value after scale correction
Definition mpu6050.h:78
float gyro_x
rotation speed(x)
Definition mpu6050.h:88
float g_z
acceleration (z)
Definition mpu6050.h:84
float g_y
acceleration (y)
Definition mpu6050.h:82
float temp_out
chip temperature
Definition mpu6050.h:86
float gyro_z
rotation speed(z)
Definition mpu6050.h:92
float g_x
acceleration (x)
Definition mpu6050.h:80
float gyro_y
rotation speed(y)
Definition mpu6050.h:90
raw data as they are captured by sensor
Definition mpu6050.h:56
int16_t gyro_x
rotation speed(x)
Definition mpu6050.h:66
int16_t g_y
acceleration (y)
Definition mpu6050.h:60
int16_t temp_out
chip temperature
Definition mpu6050.h:64
int16_t g_z
acceleration (z)
Definition mpu6050.h:62
int16_t g_x
acceleration (x)
Definition mpu6050.h:58
int16_t gyro_y
rotation speed(y)
Definition mpu6050.h:68
int16_t gyro_z
rotation speed(z)
Definition mpu6050.h:70