adafruit_mmc56x3
Python MMC5603 / MMC5613 magnetometer sensor library
Author(s): ladyada
Implementation Notes
Hardware:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
Adafruit’s Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
- class adafruit_mmc56x3.MMC5603(i2c_bus: I2C, address: int = 48)
Driver for the MMC5603 3-axis magnetometer.
Quickstart: Importing and using the device
Here is an example of using the
MMC5603
class. First you will need to import the libraries to use the sensorimport board import adafruit_mmc56x3
Once this is done you can define your
board.I2C
object and define your sensor objecti2c = board.I2C() sensor = adafruit_mmc56x3.MMC5603(i2c)
Now you have access to the
magnetic
attributemag_x, mag_y, mag_z = sensor.magnetic
- Parameters:
- property continuous_mode: bool
Whether or not to put the chip in continous mode - be sure to set the data_rate as well!
- property data_rate: int
Output data rate, 0 for on-request data. 1-255 or 1000 for freq of continuous-mode readings