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/echo.py

14 lines
216 B
Python
Raw Permalink Normal View History

2016-01-17 19:26:23 +00:00
#!/usr/bin/env python
import smbus
bus = smbus.SMBus(1)
address = 0x23
def send(data):
print 'Send / receive: ' + str(data) + ' / ' + str(bus.read_byte_data(address, data))
for d in range(1, 5):
send(d)