simple i2c bus scanner

This commit is contained in:
mandlm 2016-01-11 13:01:26 +01:00
parent cc5a97ffa4
commit ec750e9fc1

13
i2c/scan.py Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env python
import smbus
bus = smbus.SMBus(1)
for address in range(0, 127):
try:
bus.read_byte(address)
print 'device at address ' + hex(address)
except IOError:
pass