We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c584303 commit b20fc6eCopy full SHA for b20fc6e
qwiic_i2c/linux_i2c.py
@@ -279,7 +279,12 @@ def ping(self, devAddress):
279
#
280
def scan(self):
281
""" Returns a list of addresses for the devices connected to the I2C bus."""
282
- return self.i2cbus.scan()
+ foundDevices = []
283
+ # Loop over the list of legal addresses (0x08 - 0x77)
284
+ for currAddress in range(0x08, 0x78):
285
+ if self.ping(currAddress) == True:
286
+ foundDevices.append(currAddress)
287
+ return foundDevices
288
289
#-----------------------------------------------------------------------
290
# Custom method for reading +8-bit register using `i2c_msg` from `smbus2`
0 commit comments