diff --git a/i2c/scan.py b/i2c/scan.py new file mode 100755 index 0000000..4e20fb9 --- /dev/null +++ b/i2c/scan.py @@ -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 +