Loom_MPU6050 class

MPU6050 6 axis gyroscope and accelerometer sensor module.

Base classes

class LoomI2CSensor
Abstract root for I2C sensor modules.

Protected variables

float temp
Temperature. Units: °C.
float accX
X-axis acceleration value. Units: g.
float accY
Y-axis acceleration value. Units: g.
float accZ
Z-axis acceleration value. Units: g.
float gyroX
X-axis gyro value. Units: °/s.
float gyroY
Y-axis gyro value. Units: °/s.
float gyroZ
Z-axis gyro value. Units: °/s.
float accAngleX
X-axis acceleration angle.
float accAngleY
Y-axis acceleration angle.
float gyroAngleX
X-axis acceleration angle.
float gyroAngleY
Y-axis acceleration angle.
float gyroAngleZ
Z-axis acceleration angle.
float angleX
X-axis angle.
float angleY
Y-axis angle.
float angleZ
Z-axis angle.

CONSTRUCTORS / DESTRUCTOR

Loom_MPU6050(LoomManager* manager, const byte i2c_address = 0x69, const uint8_t mux_port = 255, const bool calibrate = true)
Constructor.
Loom_MPU6050(LoomManager* manager, JsonArrayConst p)
Constructor that takes Json Array, extracts args and delegates to regular constructor.
~Loom_MPU6050() defaulted virtual
Destructor.

OPERATION

void measure() override
Take any relevant measurements.
void package(JsonObject json) override
Package a modules measurements or state.
void calibrate() override
Calibration routine.

Function documentation

Loom_MPU6050::Loom_MPU6050(LoomManager* manager, const byte i2c_address = 0x69, const uint8_t mux_port = 255, const bool calibrate = true)

Constructor.

Parameters
manager
i2c_address in Set(Int) | <0x69> | {0x68, 0x69} | I2C address
mux_port in Int | <255> | [0-16] | Port on multiplexer
calibrate in Bool | <true> | {true, false} | Whether or not to calibrate at start

Loom_MPU6050::Loom_MPU6050(LoomManager* manager, JsonArrayConst p)

Constructor that takes Json Array, extracts args and delegates to regular constructor.

Parameters
manager
in The array of constuctor args to expand

void Loom_MPU6050::package(JsonObject json) override

Package a modules measurements or state.

Parameters
json out Object to put data into

void Loom_MPU6050::print_measurements() const override

Print the last set of measurements taken.

Does not package the data.