simple i2c bus scanner
parent
cc5a97ffa4
commit
ec750e9fc1
|
@ -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
|
||||
|
Loading…
Reference in New Issue