Skip to content

Commit a5e5cd5

Browse files
committed
fixed docs
1 parent e341502 commit a5e5cd5

File tree

4 files changed

+18
-23
lines changed

4 files changed

+18
-23
lines changed

README.rst

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,20 @@ Usage Example
3232

3333
.. code-block:: python
3434
35-
import time
36-
import board
37-
import busio
38-
39-
import adafruit_lsm303_accel
40-
41-
i2c = busio.I2C(board.SCL, board.SDA)
42-
sensor = adafruit_lsm303_accel.LSM303_Accel(i2c)
43-
44-
while True:
45-
raw_accel_x, raw_accel_y, raw_accel_z = sensor.raw_acceleration
46-
accel_x, accel_y, accel_z = sensor.acceleration
47-
raw_mag_x, raw_mag_y, raw_mag_z = sensor.raw_magnetic
48-
mag_x, mag_y, mag_z = sensor.magnetic
49-
50-
print('Acceleration raw: ({0:6d}, {1:6d}, {2:6d}), (m/s^2): ({3:10.3f}, {4:10.3f}, {5:10.3f})'.format(raw_accel_x, raw_accel_y, raw_accel_z, accel_x, accel_y, accel_z))
51-
print('Magnetometer raw: ({0:6d}, {1:6d}, {2:6d}), (gauss): ({3:10.3f}, {4:10.3f}, {5:10.3f})'.format(raw_mag_x, raw_mag_y, raw_mag_z, mag_x, mag_y, mag_z))
52-
print('')
53-
time.sleep(1.0)
35+
import time
36+
import board
37+
import busio
38+
import adafruit_lsm303_accel
39+
40+
i2c = busio.I2C(board.SCL, board.SDA)
41+
sensor = adafruit_lsm303_accel.LSM303_Accel(i2c)
42+
43+
while True:
44+
acc_x, acc_y, acc_z = sensor.acceleration
45+
46+
print('Acceleration (m/s^2): ({0:10.3f}, {1:10.3f}, {2:10.3f})'.format(acc_x, acc_y, acc_z))
47+
print('')
48+
time.sleep(1.0)
5449
5550
5651
Contributing
@@ -106,4 +101,4 @@ Now, once you have the virtual environment activated:
106101
107102
This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to
108103
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
109-
locally verify it will pass.
104+
locally verify it will pass.

adafruit_lsm303_accel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
# THE SOFTWARE.
2222
"""
23-
`adafruit_lsm303-accel`
23+
`adafruit_lsm303_accel`
2424
====================================================
2525
2626

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Uncomment the below if you use native CircuitPython modules such as
1919
# digitalio, micropython and busio. List the modules you use. Without it, the
2020
# autodoc module docs will fail to generate with a warning.
21-
autodoc_mock_imports = ["adafruit_bus_device"]
21+
autodoc_mock_imports = ["adafruit_bus_device", "micropython"]
2222

2323
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'BusDevice': ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
2424

examples/lsm303_accel_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Display both accelerometer and magnetometer data once per second """
1+
""" Display accelerometer data once per second """
22

33
import time
44
import board

0 commit comments

Comments
 (0)