CircuitPython module for the FXOS8700 Accelerometer/Magnetometer. Technical documentation on FXOS8700 chip is available online from NXP. The chip is available on a nice breakout board from Adafruit, see the guide at NXP Precision 9DoF Breakout.
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.
Getting the readings from accelerometer/magnetometer is easy! First, import board
module for pin definitions
for your specific microcontroller board, busio
for native I2C communication and the driver library
itself.
import board
import busio
import fxos8700
Next, initialize the I2C bus in a with
statement so it always gets shut down ok.
Then, instantiate FXOS8700 class:
# Read current acceleration for all three axes and print it out
with busio.I2C(board.SCL, board.SDA) as i2c:
s = fxos8700.FXOS8700(i2c)
print(s.acceleration)
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
.. toctree:: :maxdepth: 2 api