[SOLVED] GoPiGo3 distance and LightColor sensor


#1

Hi, Is it possible to get those two sensors working together? They both use a I2C port, and they seem to interfere with each other. The script stops working without any error messages when it’s run and after I detach the LightColor sensor it immediately starts running the script with no problems. The line where it gets stuck is where the distance sensor is initialized, which is done after initializing the lightColor sensor.


#2

Hello @t6hyja01
Yes they can be made to work together but order matters.

You need to initialize the Light Color Sensor before the Distance Sensor. The Distance Sensor will see its preferred address is already taken and will switch to its secondary address.

Cleo


#3

Thanks, it works now. I think there should me some kind of remark in the documentation regarding this issue.


#4

@t6hyja01

Glad to see it’s working just fine for you. And you do bring a good point about the documentation. I guess we forgot about that one.

Cleo