I am using an Atlas Scientific I2C sensor and trying to connect it to the Pi. http://www.atlas-scientific.com/_files/_datasheets/_circuit/EC_EZO_Datasheet.pdf
Here's the code that I'm running:
import smbus
import time
bus = smbus.SMBus(1)
def read_sensor(addr):
bus.write_byte(addr,0x52)
time.sleep(1) # This is required by the sensor
for i in range (0,32):
print bus.read_byte(addr)
I also try:
result = bus.read_i2c_block_data(addr,0x52)
print result # returns 1, then 255's
When I write 0x52, the light changes as it should, then when I read a byte, the first byte is 1, meaning that it is successful, but the rest of the bytes are 255.
How can I trigger the read by sending 0x52, then wait a second while the sensor takes its readings, the read the 32 bytes available WITHOUT sending any additional commands.
I looked into pyA13 library, but this apparently doesn't run on Pi.
Can Python do this?