My analog card give only some Zeros
Do you know if there is an library update of the seedStudio to be able to read the analog values of the card ?
or
as recommended in a post:
‘Problem with 8-Channel 12-Bit ADC / I2C adress and no input value’ dec. '21 + neracali april 22
I tried to use an other function than the seedStudio by spliting the function to read but in Python and still obtain zero values.
any error in the code or parameters ? an idea ? thanks
ADC_DEFAULT_IIC_ADDR = 0X08
DC_CHAN_NUM = 8
REG_RAW_DATA_START = 0X10
REG_VOL_START = 0X20
REG_RTO_START = 0X30
REG_SET_ADDR = 0XC0
from periphery import I2C
i2c = I2C("/dev/i2c-1")
dataRX = [0,0,0]
msgs = [I2C.Message(data=[REG_VOL_START],read=False,flags = 0 ), I2C.Message(data=dataRX,read=True, flags = 1)]
i2c.transfer(ADC_DEFAULT_IIC_ADDR, [msgs[0]])
i2c.transfer(ADC_DEFAULT_IIC_ADDR, [msgs[1]])
for i in range(0,len(msgs[1].data)):
print(hex(msgs[1].data[i]))
i2c.close()