Skip to content

Commit cacf2c7

Browse files
committed
linted and docs updated
1 parent aea519f commit cacf2c7

9 files changed

+37
-263
lines changed

README.rst

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ This is easily achieved by downloading
3131

3232
Installing from PyPI
3333
=====================
34-
.. note:: This library is not available on PyPI yet. Install documentation is included
35-
as a standard element. Stay tuned for PyPI availability!
36-
37-
.. todo:: Remove the above note if PyPI version is/will be available at time of release.
38-
If the library is not planned for PyPI, remove the entire 'Installing from PyPI' section.
3934

4035
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
4136
PyPI <https://pypi.org/project/adafruit-circuitpython-lsm6dsox/>`_. To install for current user:
@@ -61,8 +56,22 @@ To install in a virtual environment in your current project:
6156
6257
Usage Example
6358
=============
59+
.. code-block:: python
60+
61+
import time
62+
import board
63+
import busio
64+
import adafruit_lsm6dsox
65+
66+
i2c = busio.I2C(board.SCL, board.SDA)
67+
68+
sox = adafruit_lsm6dsox.LSM6DSOX(i2c)
6469
65-
.. todo:: Add a quick, simple example. It and other examples should live in the examples folder and be included in docs/examples.rst.
70+
while True:
71+
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2"%(sox.acceleration))
72+
print("Gyro X:%.2f, Y: %.2f, Z: %.2f degrees/s"%(sox.gyro))
73+
print("")
74+
time.sleep(0.5)
6675
6776
Contributing
6877
============

adafruit_debug_i2c.py

Lines changed: 0 additions & 173 deletions
This file was deleted.

adafruit_lsm6dsox.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
3434
**Hardware:**
3535
36-
* `Adafruit LSM6DSOX Breakout https://www.adafruit.com/products/4438`_
36+
* Adafruit LSM6DSOX Breakout <https://www.adafruit.com/products/4438>
3737
3838
3939
**Software and Dependencies:**
@@ -111,7 +111,7 @@ def is_valid(cls, value):
111111
return value in cls.string
112112

113113
class AccelRange(CV):
114-
"""Options for `accelerometer_range`"""
114+
"""Options for ``accelerometer_range``"""
115115
pass #pylint: disable=unnecessary-pass
116116

117117
AccelRange.add_values((
@@ -122,7 +122,7 @@ class AccelRange(CV):
122122
))
123123

124124
class GyroRange(CV):
125-
"""Options for `gyro_data_range`"""
125+
"""Options for ``gyro_data_range``"""
126126
pass #pylint: disable=unnecessary-pass
127127

128128
GyroRange.add_values((
@@ -133,7 +133,7 @@ class GyroRange(CV):
133133
))
134134

135135
class Rate(CV):
136-
"""Options for `data_rate`"""
136+
"""Options for ``accelerometer_data_rate`` and ``gyro_data_rate``"""
137137
pass #pylint: disable=unnecessary-pass
138138

139139
Rate.add_values((
@@ -239,7 +239,7 @@ def reset(self):
239239

240240
@property
241241
def acceleration(self):
242-
"""Acceleration!"""
242+
"""The x, y, z acceleration values returned in a 3-tuple and are in m / s ^ 2."""
243243
raw_accel_data = self._raw_accel_data
244244
x = self._scale_xl_data(raw_accel_data[0])
245245
y = self._scale_xl_data(raw_accel_data[1])
@@ -249,7 +249,7 @@ def acceleration(self):
249249

250250
@property
251251
def gyro(self):
252-
"""ME GRYO, ME FLY PLANE"""
252+
"""The x, y, z angular velocity values returned in a 3-tuple and are in degrees / second"""
253253
raw_gyro_data = self._raw_gyro_data
254254
x = self._scale_gyro_data(raw_gyro_data[0])
255255
y = self._scale_gyro_data(raw_gyro_data[1])

docs/index.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,11 @@ Table of Contents
2020

2121
api
2222

23-
.. toctree::
24-
:caption: Tutorials
25-
26-
.. todo:: Add any Learn guide links here. If there are none, then simply delete this todo and leave
27-
the toctree above for use later.
28-
2923
.. toctree::
3024
:caption: Related Products
3125

32-
.. todo:: Add any product links here. If there are none, then simply delete this todo and leave
33-
the toctree above for use later.
26+
Adafruit LSM6DSOX Breakout <https://www.adafruit.com/products/4438>
27+
3428

3529
.. toctree::
3630
:caption: Other Links

examples/lsm6dsox_full_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import time
21
import board
32
import busio
43
from adafruit_lsm6dsox import LSM6DSOX, Rate, AccelRange, GyroRange
5-
4+
#pylint:disable=no-member
65
i2c = busio.I2C(board.SCL, board.SDA)
76
sox = LSM6DSOX(i2c)
87

@@ -20,4 +19,4 @@
2019

2120
while True:
2221
print("Accel X:%.2f Y:%.2f Z:%.2f ms^2 Gyro X:%.2f Y:%.2f Z:%.2f degrees/s"%
23-
(sox.acceleration+sox.gyro))
22+
(sox.acceleration+sox.gyro))

examples/lsm6dsox_rate_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import time
21
import board
32
import busio
43
import adafruit_lsm6dsox
5-
from adafruit_debug_i2c import DebugI2C
4+
#pylint:disable=no-member
65

76
i2c = busio.I2C(board.SCL, board.SDA)
8-
# i2c = DebugI2C(busio.I2C(board.SCL, board.SDA))
97

108
sox = adafruit_lsm6dsox.LSM6DSOX(i2c)
119

examples/lsm6dsox_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2"%(sox.acceleration))
1212
print("Gyro X:%.2f, Y: %.2f, Z: %.2f degrees/s"%(sox.gyro))
1313
print("")
14-
time.sleep(0.5)
14+
time.sleep(0.5)

examples/lsm6dsox_tester.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)