This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
Pi/i2c/scan.py

14 lines
217 B
Python
Executable File

#!/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