Skip to content

Commit 68a7310

Browse files
committed
polishing docs
1 parent f7dd2cb commit 68a7310

File tree

6 files changed

+23
-9
lines changed

6 files changed

+23
-9
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ bundles
99
*.DS_Store
1010
.eggs
1111
dist
12-
**/*.egg-info
12+
**/*.egg-info
13+
.vscode

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This driver depends on:
2222

2323
* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_
2424
* `Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_
25+
* `Register <https://github.com/adafruit/Adafruit_CircuitPython_Register>`_
2526

2627
Please ensure all dependencies are available on the CircuitPython filesystem.
2728
This is easily achieved by downloading

adafruit_lsm303agr_mag.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
https://circuitpython.org/downloads
4545
* Adafruit's Bus Device library:
4646
https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
47+
* Adafruit's Register library:
48+
https://github.com/adafruit/Adafruit_CircuitPython_Register
4749
"""
4850

4951
from time import sleep
@@ -65,10 +67,14 @@
6567

6668
class DataRate: # pylint: disable=too-few-public-methods
6769
"""Data rate choices to set using `data_rate`"""
68-
Rate_10_HZ = const(0x00) # 10 Hz
69-
Rate_20_HZ = const(0x01) # 20 Hz
70-
Rate_50_HZ = const(0x02) # 50 Hz
71-
Rate_100_HZ = const(0x03) # 100 Hz
70+
Rate_10_HZ = const(0x00)
71+
"""10 Hz"""
72+
Rate_20_HZ = const(0x01)
73+
"""20 Hz"""
74+
Rate_50_HZ = const(0x02)
75+
"""50 Hz"""
76+
Rate_100_HZ = const(0x03)
77+
"""100 Hz"""
7278

7379

7480
# Magnetometer registers
@@ -98,7 +104,12 @@ class DataRate: # pylint: disable=too-few-public-methods
98104
_MAG_SCALE = 0.15 # 1.5 milligauss/LSB * 0.1 microtesla/milligauss
99105

100106
class LSM303AGR_Mag:# pylint: disable=too-many-instance-attributes
101-
"""Driver for the LSM303AGR's 'magnetometer."""
107+
"""
108+
Driver for the Driver for the LSM303AGR's 'magnetometer.
109+
110+
:param busio.I2C i2c_bus: The I2C bus the LSM303AGR is connected to.
111+
112+
"""
102113
_BUFFER = bytearray(6)
103114

104115
_device_id = ROUnaryStruct(WHO_AM_I, "B")
@@ -163,7 +174,7 @@ def reset(self):
163174
self._interrupt_pin_putput = True
164175
self._temp_comp = True
165176

166-
sleep(0.020) # sleep 20ms to allow measurements to stabilize
177+
sleep(0.030) # sleep 20ms to allow measurements to stabilize
167178

168179
@property
169180
def magnetic(self):

examples/lsm303agr_mag_interrupt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
print("Int triggered: %s"%int_triggered)
1818
print()
1919

20-
time.sleep(1)
20+
time.sleep(1)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Adafruit-Blinka
22
adafruit-circuitpython-busdevice
3+
adafruit-circuitpython-register

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
author='Adafruit Industries',
3535
author_email='circuitpython@adafruit.com',
3636

37-
install_requires=['Adafruit-Blinka', 'adafruit-circuitpython-busdevice'],
37+
install_requires=['Adafruit-Blinka', 'adafruit-circuitpython-busdevice', 'adafruit-circuitpython-register'],
3838

3939
# Choose your license
4040
license='MIT',

0 commit comments

Comments
 (0)