readReg() function showing unknown error.
Here i am using AT24C256 EEPROM with I2C_1
code:
import mraa as m
import time
x = m.I2c(1)
while(1):
x.address(0xA0)
x.writeReg(0x0000,0x55) # also tried x.writeReg(0x00,0x55)
time.sleep(5)
x.address(0xA0)
if x.readReg(0x0000)== 0x55: # x.readReg(0x00)
print("EEPROM OK")
else:
print("EEPROM NOT OK")
Error:
root@rb-imx6ul:~/programs# vi EEPROM.py
root@rb-imx6ul:~/programs# python3 EEPROM.py
Traceback (most recent call last):
File "EEPROM.py", line 14, in <module>
if x.readReg(0x0000)== 0x55:
File "/usr/lib/python3.5/site-packages/mraa.py", line 549, in readReg
return _mraa.I2c_readReg(self, reg)
ValueError: Unknown error in I2c::readReg()