OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
hardware_io.imu.mpu6050_imu.Mpu6050Imu Class Reference

Provide accelerometer and gyroscope data from an MPU-6050. More...

Inheritance diagram for hardware_io.imu.mpu6050_imu.Mpu6050Imu:
hardware_io.imu.imu_if.ImuIf

Public Member Functions

None __init__ (self, Any|None i2c_bus=None, int address=DEFAULT_ADDRESS)
 Initialize the MPU-6050 driver configuration.
 
None start (self)
 Initialize the I2C bus and MPU-6050 sensor.
 
None stop (self)
 Release resources owned by the MPU-6050 driver.
 
bool is_connected (self)
 Return whether the MPU-6050 has been initialized.
 
Vector3 get_acceleration_mps2 (self)
 Return acceleration along each axis in meters per second squared.
 
Vector3 get_angular_velocity_rad_s (self)
 Return angular velocity along each axis in radians per second.
 

Protected Member Functions

Any _require_sensor (self)
 Return the initialized sensor or raise an error.
 
None _release_i2c_bus (self)
 Release the internally created I2C bus.
 

Detailed Description

Provide accelerometer and gyroscope data from an MPU-6050.

Constructor & Destructor Documentation

◆ __init__()

None hardware_io.imu.mpu6050_imu.Mpu6050Imu.__init__ (   self,
Any | None   i2c_bus = None,
int   address = DEFAULT_ADDRESS 
)

Initialize the MPU-6050 driver configuration.

Args: i2c_bus: Optional existing CircuitPython-compatible I2C bus. When omitted, the driver creates the default board I2C bus.

address:

I2C address of the MPU-6050. The default address is 0x68.


The documentation for this class was generated from the following file: