simple i2c bus scanner

master
mandlm 2016-01-11 13:01:26 +01:00
parent cc5a97ffa4
commit ec750e9fc1
1 changed files with 13 additions and 0 deletions

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