MPU6050 — X/Y/Z axis acceleration (mpu6050_get_accel)¶
What it does: Returns the acceleration of the selected axis (X, Y, Z) from the MPU6050 accelerometer.

Inputs¶
- Field
axis: axis selection (X,Y,Z).
Output¶
- Number: acceleration of the selected axis (unit according to the used library).
When to use it¶
- For detecting movement, vibration or orientation to gravity.
- After
mpu6050 aktualizovat datato match current data.
Tips and pitfalls¶
- Accelerometer range depends on library configuration (typically from ±2g to ±16g).
- When static, expect a gravitational acceleration component on one axis.
Usage example¶

Generated Python example¶
value = mpu.getAccel()[0]