sts1_sensors.edu.L3GD20H

Module Contents

class L3GD20H(range=245, datarate=12.5, address=None, bus=None)

Three-axis gyroscope.

Parameters:
  • range (int) – Maximum angular velocity or speed of rotation that the gyro can read, measured in degrees per second (dps). Allowed values: [245, 500, 2000], defaults to 245.

  • datarate (float) – Number of measurements per second [Hz]. Allowed values: [12.5, 25, 50, 100, 200, 400, 800], defaults to 12.5.

  • address (hexadecimal) – Physical address of the sensor on the board (see i2cdetect command). Allowed values: [0x6A, 0x6B]. If None, the environment variable STS1_SENSOR_ADDRESS_L3GD20H will be used. If environment variable is not found, 0x6A will be used.

  • bus (SMBus) – A SMBus object. If None, this class will generate its own, defaults to None.

Example:

gyro = L3GD20H(range=245, datarate=12.5)
x, y, z = gyro.get_dps()
print(f"{x=:.2f} dps, {y=:.2f} dps, {z=:.2f} dps")
property range
property datarate
get_dps_raw()

Get raw degrees per second.

get_dps()

Get degrees per second.