i2cscan.py 179 B

1234567891011
  1. import smbus
  2. s=smbus.SMBus(1)
  3. for i in range(3,127):
  4. try:
  5. s.read_byte(i)
  6. print("\nI2C detected: "+hex(i))
  7. except:
  8. print("skip: "+hex(i)+', ',end='',flush=True)