2323
2424**Software and Dependencies:**
2525
26- * Adafruit CircuitPython firmware (2.2.0+) for the ESP8622 and M0-based boards:
27- https://github.com/adafruit/circuitpython/releases
26+ * Adafruit CircuitPython firmware for the supported boards:
27+ https://circuitpython.org/downloads
2828
2929* Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
3030"""
@@ -87,7 +87,38 @@ def _twos_comp(val, bits):
8787
8888
8989class FXOS8700 :
90- """Driver for the NXP FXOS8700 accelerometer and magnetometer."""
90+ """Driver for the NXP FXOS8700 accelerometer and magnetometer.
91+
92+ :param ~busio.I2C i2c: The I2C bus the device is connected to
93+ :param int address: The I2C device address. Defaults to :const:`0x1F`
94+ :param int accel_range: Device range. Defaults to :const:`0x00`.
95+
96+
97+ **Quickstart: Importing and using the device**
98+
99+ Here is an example of using the :class:`FXOS8700` class.
100+ First you will need to import the libraries to use the sensor
101+
102+ .. code-block:: python
103+
104+ import board
105+ import adafruit_fxos8700
106+
107+ Once this is done you can define your `board.I2C` object and define your sensor object
108+
109+ .. code-block:: python
110+
111+ i2c = board.I2C() # uses board.SCL and board.SDA
112+ sensor = adafruit_fxos8700.FXOS8700(i2c)
113+
114+ Now you have access to the :attr:`accelerometer` and :attr:`magnetometer` attributes
115+
116+ .. code-block:: python
117+
118+ accel_x, accel_y, accel_z = sensor.accelerometer
119+ mag_x, mag_y, mag_z = sensor.magnetometer
120+
121+ """
91122
92123 # Class-level buffer for reading and writing data with the sensor.
93124 # This reduces memory allocations but means the code is not re-entrant or
@@ -171,7 +202,7 @@ def read_raw_accel_mag(self):
171202 @property
172203 def accelerometer (self ):
173204 """Read the acceleration from the accelerometer and return its X, Y, Z axis values as a
174- 3-tuple in m/s^2.
205+ 3-tuple in :math:` m/s^2` .
175206 """
176207 accel_raw , _ = self .read_raw_accel_mag ()
177208 # Convert accel values to m/s^2
@@ -187,7 +218,7 @@ def accelerometer(self):
187218 @property
188219 def magnetometer (self ):
189220 """
190- Read the magnetometer values and return its X, Y, Z axis values as a 3-tuple in uTeslas .
221+ Read the magnetometer values and return its X, Y, Z axis values as a 3-tuple in μTeslas .
191222 """
192223 _ , mag_raw = self .read_raw_accel_mag ()
193224 # Convert mag values to uTesla
0 commit comments