![]() |
Core2 for AWS IoT EduKit BSP 1.5.1
|
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.
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 features to set the features you want to enable.
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. From within a FreeRTOS task that loops every 200ms, it retrieves the accelerometer data which it stores in the variables accel_x, accel_y, and accel_z. Lastly, it prints the values using the ESP logger.