1.. zephyr:code-sample:: mpu6050 2 :name: MPU6050 motion tracking device 3 :relevant-api: sensor_interface 4 5 Get temperature, acceleration, and angular velocity from an MPU6050 sensor (polling & trigger 6 mode). 7 8Description 9*********** 10 11This sample application periodically (0.5 Hz) measures the sensor 12temperature, acceleration, and angular velocity, displaying the values 13on the console along with a timestamp since startup. 14 15When triggered mode is enabled the measurements are displayed at the 16rate they are produced by the sensor. 17 18Wiring 19******* 20 21This sample uses an external breakout for the sensor. A devicetree 22overlay must be provided to identify the I2C bus and GPIO used to 23control the sensor. 24 25Building and Running 26******************** 27 28After providing a devicetree overlay that specifies the sensor location, 29build this sample app using: 30 31.. zephyr-app-commands:: 32 :zephyr-app: samples/sensor/mpu6050 33 :board: nrf52dk/nrf52832 34 :goals: build flash 35 36Sample Output 37============= 38 39.. code-block:: console 40 41 *** Booting Zephyr OS build zephyr-v2.1.0-576-g4b38659b0661 *** 42 [0:00:00.008]:23.6359 Cel 43 accel -5.882554 -6.485893 5.868188 m/s/s 44 gyro 0.014522 0.002264 -0.036905 rad/s 45 [0:00:02.020]:23.6359 Cel 46 accel -5.841853 -6.435615 5.911283 m/s/s 47 gyro 0.017852 0.001199 -0.034640 rad/s 48 [0:00:04.032]:23.6829 Cel 49 accel -5.930438 -6.461951 6.009446 m/s/s 50 gyro 0.012923 0.002131 -0.037171 rad/s 51 [0:00:06.044]:23.6359 Cel 52 accel -5.884948 -6.524200 5.961562 m/s/s 53 gyro 0.012390 -0.001732 -0.045964 rad/s 54 [0:00:08.056]:35.7712 Cel 55 accel -5.863400 -12.872426 -0.154427 m/s/s 56 gyro -0.034373 -0.034373 -0.034373 rad/s 57 [0:00:10.068]:23.6829 Cel 58 accel -5.906496 -6.461951 5.899312 m/s/s 59 gyro 0.015321 -0.000399 -0.039169 rad/s 60 61<repeats endlessly> 62