Skip to content

Commit 1a170ad

Browse files
committed
removed explicit mentions of "XSHUT" pin
1 parent d16485b commit 1a170ad

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

adafruit_vl53l0x.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,15 +459,14 @@ def set_address(self, new_address):
459459
multiple VL53L0X sensors on the same I2C bus (SDA & SCL pins). See also the
460460
`example <examples.html#multiple-vl53l0x-on-same-i2c-bus>`_ for proper usage.
461461
462-
:param int new_address: The 8-bit `int` that is to be assigned to the VL53L0X sensor.
462+
:param int new_address: The 7-bit `int` that is to be assigned to the VL53L0X sensor.
463463
The address that is assigned should NOT be already in use by another device on the
464464
I2C bus.
465465
466466
.. important:: To properly set the address to an individual VL53L0X sensor, you must
467-
first ensure that all other VL53L0X sensors on the same I2C bus are in their off state
468-
by pulling the "SHDN" pins LOW. When the "SHDN" pin is pulled HIGH again the
469-
default I2C address is 0x29. The "SHDN" pin is usually labeled "XSHUT" on
470-
non-Adafruit breakout boards.
467+
first ensure that all other VL53L0X sensors (using the default address of ``0x29``)
468+
on the same I2C bus are in their off state by pulling the "SHDN" pins LOW. When the
469+
"SHDN" pin is pulled HIGH again the default I2C address is ``0x29``.
471470
"""
472471
self._write_u8(_I2C_SLAVE_DEVICE_ADDRESS, new_address & 0x7f)
473472
self._device.device_address = new_address

examples/vl53l0x_multiple_sensors.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
# declare the digital output pins connected to the "SHDN" pin on each VL53L0X sensor
1717
xshut = [
1818
DigitalInOut(board.D7),
19-
DigitalInOut(board.D9)
20-
# add more sensors by defining their SHDN pins here
19+
DigitalInOut(board.D9),
20+
# add more VL53L0X sensors by defining their SHDN pins here
2121
]
2222

2323
for power_pin in xshut:
@@ -33,11 +33,11 @@
3333

3434
# now change the addresses of the VL53L0X sensors
3535
for i, power_pin in enumerate(xshut):
36-
# turn on the sensor to allow hardware check
36+
# turn on the VL53L0X to allow hardware check
3737
power_pin.value = True
38-
# instantiate the VL53L0X sensors on the I2C bus & insert it into the "vl53" list
39-
vl53.insert(i, VL53L0X(i2c)) # also performs hardware check
40-
# don't need to change the address of the last VL53L0X sensor
38+
# instantiate the VL53L0X sensor on the I2C bus & insert it into the "vl53" list
39+
vl53.insert(i, VL53L0X(i2c)) # also performs VL53L0X hardware check
40+
# no need to change the address of the last VL53L0X sensor
4141
if i < len(xshut) - 1:
4242
# default address is 0x29. Change that to something else
4343
vl53[i].set_address(i + 0x30) # address assigned should NOT be already in use
@@ -46,11 +46,11 @@
4646
# According to this list 0x30-0x34 are available, although the list may be incomplete.
4747
# In the python REPR, you can scan for all I2C devices that are attached and detirmine
4848
# their addresses using:
49-
# >>> import busio
50-
# >>> i2c = busio.I2C(board.SCL, board.SDA)
51-
# >>> if i2c.try_lock(): # i2c.scan() requires a lock on the I2C bus
49+
# >>> import board
50+
# >>> i2c = board.I2C()
51+
# >>> if i2c.try_lock():
5252
# >>> [hex(x) for x in i2c.scan()]
53-
# >>> i2c.unlock() # free up the bus for something else to use it
53+
# >>> i2c.unlock()
5454

5555
def detect_range(count=5):
5656
""" take count=5 samples """

0 commit comments

Comments
 (0)