Golang I2C problem

Hi everyone. I am using Golang for IoT projects which I need to read from an I2C light sensor. My platform is Onion Omega 2 and the light sensor is VEML7700. My Golang version is 1.14. I try 2 different I2C libraries: one is the official one, the other is go-i2c.
None of them I can use to read any data from the sensor. I can write to the register of the sensor. When I try to use the Linux i2cget command, I can see the value in the register. But when I try to read from it, I only get zero and no error is raised.
I wonder is anybody working with this sensor before or have any idea about the I2C library.
Thanks!

Is it possible the sensor hardware is defective? Is there a test utility that you can use to check that?

Yeah. I have an Arduino to test with it and it works.

The solution I find is using another driver from gobot. They have a better implementation for the I2C protocol.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.