|
44 | 44 | https://circuitpython.org/downloads |
45 | 45 | * Adafruit's Bus Device library: |
46 | 46 | https://github.com/adafruit/Adafruit_CircuitPython_BusDevice |
| 47 | +* Adafruit's Register library: |
| 48 | + https://github.com/adafruit/Adafruit_CircuitPython_Register |
47 | 49 | """ |
48 | 50 |
|
49 | 51 | from time import sleep |
|
65 | 67 |
|
66 | 68 | class DataRate: # pylint: disable=too-few-public-methods |
67 | 69 | """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""" |
72 | 78 |
|
73 | 79 |
|
74 | 80 | # Magnetometer registers |
@@ -98,7 +104,12 @@ class DataRate: # pylint: disable=too-few-public-methods |
98 | 104 | _MAG_SCALE = 0.15 # 1.5 milligauss/LSB * 0.1 microtesla/milligauss |
99 | 105 |
|
100 | 106 | 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 | + """ |
102 | 113 | _BUFFER = bytearray(6) |
103 | 114 |
|
104 | 115 | _device_id = ROUnaryStruct(WHO_AM_I, "B") |
@@ -163,7 +174,7 @@ def reset(self): |
163 | 174 | self._interrupt_pin_putput = True |
164 | 175 | self._temp_comp = True |
165 | 176 |
|
166 | | - sleep(0.020) # sleep 20ms to allow measurements to stabilize |
| 177 | + sleep(0.030) # sleep 20ms to allow measurements to stabilize |
167 | 178 |
|
168 | 179 | @property |
169 | 180 | def magnetic(self): |
|
0 commit comments