@@ -95,12 +95,13 @@ class VL6180X:
95
95
"""Create an instance of the VL6180X distance sensor. You must pass in
96
96
the following parameters:
97
97
98
- :param i2c: An instance of the I2C bus connected to the sensor.
98
+ :param ~I2C i2c: An instance of the I2C bus connected to the sensor.
99
99
100
100
Optionally you can specify:
101
101
102
- :param address: The I2C address of the sensor. If not specified the sensor's
102
+ :param int address: The I2C address of the sensor. If not specified the sensor's
103
103
default value will be assumed.
104
+ :param int offset: The offset to be applied to measurements, in mm
104
105
"""
105
106
106
107
def __init__ (
@@ -168,7 +169,8 @@ def range_history_enabled(self) -> bool:
168
169
169
170
def start_range_continuous (self , period : int = 100 ) -> None :
170
171
"""Start continuous range mode
171
- :param period: Time delay between measurements in ms
172
+
173
+ :param int period: Time delay between measurements, in milliseconds
172
174
"""
173
175
# Set range between measurements
174
176
period_reg : int = 0
@@ -230,14 +232,22 @@ def _read_range_continuous(self) -> int:
230
232
def read_lux (self , gain : int ) -> float :
231
233
"""Read the lux (light value) from the sensor and return it. Must
232
234
specify the gain value to use for the lux reading:
233
- - ALS_GAIN_1 = 1x
234
- - ALS_GAIN_1_25 = 1.25x
235
- - ALS_GAIN_1_67 = 1.67x
236
- - ALS_GAIN_2_5 = 2.5x
237
- - ALS_GAIN_5 = 5x
238
- - ALS_GAIN_10 = 10x
239
- - ALS_GAIN_20 = 20x
240
- - ALS_GAIN_40 = 40x
235
+
236
+ ================= =====
237
+ Setting Value
238
+ ================= =====
239
+ ``ALS_GAIN_1`` 1x
240
+ ``ALS_GAIN_1_25`` 1.25x
241
+ ``ALS_GAIN_1_67`` 1.67x
242
+ ``ALS_GAIN_2_5`` 2.5x
243
+ ``ALS_GAIN_5`` 5x
244
+ ``ALS_GAIN_10`` 10x
245
+ ``ALS_GAIN_20`` 20x
246
+ ``ALS_GAIN_40`` 40x
247
+ ================= =====
248
+
249
+ :param int gain: The gain value to use
250
+
241
251
"""
242
252
reg = self ._read_8 (_VL6180X_REG_SYSTEM_INTERRUPT_CONFIG )
243
253
reg &= ~ 0x38
@@ -286,17 +296,22 @@ def range_status(self) -> int:
286
296
"""Retrieve the status/error from a previous range read. This will
287
297
return a constant value such as:
288
298
289
- - ERROR_NONE - No error
290
- - ERROR_SYSERR_1 - System error 1 (see datasheet)
291
- - ERROR_SYSERR_5 - System error 5 (see datasheet)
292
- - ERROR_ECEFAIL - ECE failure
293
- - ERROR_NOCONVERGE - No convergence
294
- - ERROR_RANGEIGNORE - Outside range ignored
295
- - ERROR_SNR - Too much noise
296
- - ERROR_RAWUFLOW - Raw value underflow
297
- - ERROR_RAWOFLOW - Raw value overflow
298
- - ERROR_RANGEUFLOW - Range underflow
299
- - ERROR_RANGEOFLOW - Range overflow
299
+ ===================== ==============================
300
+ Error Description
301
+ ===================== ==============================
302
+ ``ERROR_NONE`` No error
303
+ ``ERROR_SYSERR_1`` System error 1 (see datasheet)
304
+ ``ERROR_SYSERR_5`` System error 5 (see datasheet)
305
+ ``ERROR_ECEFAIL`` ECE failure
306
+ ``ERROR_NOCONVERGE`` No convergence
307
+ ``ERROR_RANGEIGNORE`` Outside range ignored
308
+ ``ERROR_SNR`` Too much noise
309
+ ``ERROR_RAWUFLOW`` Raw value underflow
310
+ ``ERROR_RAWOFLOW`` Raw value overflow
311
+ ``ERROR_RANGEUFLOW`` Range underflow
312
+ ``ERROR_RANGEOFLOW`` Range overflow
313
+ ===================== ==============================
314
+
300
315
"""
301
316
return self ._read_8 (_VL6180X_REG_RESULT_RANGE_STATUS ) >> 4
302
317
0 commit comments