1 #ifndef MAIN_MPU6050_H_
2 #define MAIN_MPU6050_H_
6 #include <driver/gpio.h>
74 return sqrt(accel_x * accel_x + accel_y * accel_y + accel_z * accel_z);
83 short accel_x, accel_y, accel_z;
84 short gyro_x, gyro_y, gyro_z;
short getAccelZ() const
Get the Z acceleration value.
Definition: MPU6050.h:40
void init(gpio_num_t sdaPin=I2C::DEFAULT_SDA_PIN, gpio_num_t clkPin=I2C::DEFAULT_CLK_PIN)
Initialize the MPU6050.
Definition: MPU6050.cpp:87
static const gpio_num_t DEFAULT_SDA_PIN
The default SDA pin.
Definition: I2C.h:24
short getGyroY() const
Get the Y gyroscopic value.
Definition: MPU6050.h:54
short getGyroX() const
Get the X gyroscopic value.
Definition: MPU6050.h:47
short getGyroZ() const
Get the Z gyroscopic value.
Definition: MPU6050.h:61
Driver for the MPU6050 accelerometer and gyroscope.
Definition: MPU6050.h:18
short getAccelY() const
Get the Y acceleration value.
Definition: MPU6050.h:33
static const gpio_num_t DEFAULT_CLK_PIN
The default Clock pin.
Definition: I2C.h:29
short getAccelX() const
Get the X acceleration value.
Definition: MPU6050.h:26
void readAccel()
Read the acceleration value from the device.
Definition: MPU6050.cpp:38
Interface to I2C functions.
Definition: I2C.h:19
uint32_t getMagnitude()
Get the magnitude of the acceleration.
Definition: MPU6050.h:73
virtual ~MPU6050()
Destory the class instance.
Definition: MPU6050.cpp:27
MPU6050()
Construct an MPU6050 handler.
Definition: MPU6050.cpp:16
void readGyro()
Read the gyroscopic values from the device.
Definition: MPU6050.cpp:62