Core2 for AWS IoT EduKit BSP  1.4.0
MPU6886

The MPU6886 library provides convenience functions to interact with the 6-axis Inertial Measurement Unit (IMU) and built-in internal temperature sensor. The initialization function configures the Inertial Measurement Unit and the built-in internal temperature sensor with preset parameters.

Circuit Block Diagram for the MPU6886 6-axis inertial measurement unit

To enable this feature using KConfig, use the command pio run --environment core2foraws --target menuconfig from within the root of the project directory in your PlatformIO terminal window and go to the menu Component Config --> Core2 for AWS hardware enable to set the features you want to enable.

Example

The following example initializes the Core2 for AWS, which initializes the PMU for the battery and other user enabled hardware features — such as the MPU6886. It then retrieves the accelerometer data which is stored in accel_x, accel_y, and accel_z. Lastly, it prints the values using the ESP logger.

#include "esp_log.h"
#include "core2foraws.h"
#include "mpu6886.h"
static const char *TAG = "EXAMPLE";
void app_main(void){
float accel_x = 0.00;
float accel_y = 0.00;
float accel_z = 0.00;
MPU6886_GetAccelData(&accel_x, &accel_y, &accel_z);
ESP_LOGI(TAG, "X: %.2f -- Y; %.2f -- Z: %.2f", accel_x, accel_y, accel_z);
}
Functions to initialize and access Core2 for AWS IoT EduKit hardware features.
void Core2ForAWS_Init(void)
Initializes the power chip with default values, enables battery charging, and initializes all enabled...
Definition: core2forAWS.c:32
Functions for the MPU6886 inertial measurement unit (IMU).
void MPU6886_GetAccelData(float *ax, float *ay, float *az)
Retrieves the accelerometer measurements from the MPU6886.
Definition: mpu6886.c:162

Enumerated Type Definitions

Functions