sts1_sensors.edu.BMM150 ======================= .. py:module:: sts1_sensors.edu.BMM150 Module Contents --------------- .. py:class:: BMM150(address=None, bus=None) Geomagnetic sensor. Builds on top of the library `bmm150 `_. :param hexadecimal address: Physical address of the sensor on the board (see `i2cdetect` command). Allowed values: `[0x10, 0x11, 0x12, 0x13]`. If None, the environment variable `STS1_SENSOR_ADDRESS_BMM150` will be used. If environment variable is not found, 0x10 will be used. :param SMBus bus: A SMBus object. If None, this class will generate its own, defaults to None. Example: .. code-block:: python mag = BMM150() x, y, z = mag.get_magnetic_data() print(f"{x=:.2f} µT, {y=:.2f} µT, {z=:.2f} µT") print(f"Heading: {mag.get_heading():.2f}°") .. py:property:: address .. py:method:: get_raw_magnetic_data() Get raw magnetic data in µT. .. py:method:: get_magnetic_data() Get magnetic data in µT. .. py:method:: get_heading() Get heading direction in degrees. Uses only x and y for calculation (z is ignored).