I’m using a ESP32 and i’m trying to write a driver for the CCS811 I2C device, but i’m experiencing problems when i try to do i2c read or write function.
I just simply want to read a byte from the status register of the device by coding:
where self is the CCS811 class that inherits the I2C class and CCS811_STATUS is the address of the status register.
The problem is: it doesn’t raise exceptions or anything, but the value i get from the write_read function is a ‘?’ character. It Seems like the connections are correct and the device can communicate with the board, but all i get is this ‘?’ character.
This happens no matter what register i try to read, no matter if i use the write_read() or if i use the write() and the read() separately.
I’m certain that the sensor is working fine because with the arduino uno and adafruit driver (which is the one i’m translating) it work flawlessly.