Rev Color Sensor Stops Outputting

We are using a Rev Color Sensor V3 at our intake to detect the ball’s presence and color when we pick it up. The sensor is plugged in to the MXP I2C port because of the suspected bug with the onboard I2C. I am printing out some raw sensor values to Shuffleboard to try and debug. The color sensor works fine for a while displaying ~160 proximity, then eventually it displays that it detects 0 proximity and also 0 red and 0 blue from the getRed() and getBlue() methods. Restarting the Rio through the driver stations seems to fix the issue, so it would seem like it is a code problem, but I am outputting raw values from the sensor, so I actually have no clue what could be wrong.

Here is our code if anyone wants to see if I am doing anything blatantly wrong. https://github.com/pittsfordrobotics/RapidReact2022/blob/master/src/main/java/frc/robot/subsystems/Indexer.java

We tested with the REV color sensor for the first time this season today and saw the same problem, we don’t have a fix yet.

1 Like

See:

1 Like

I’ve seen that thread before, but I never got the the part about then MXP port also being problematic, especially when on WPILib they put using the MXP port as a solution to this I2C problem. Thanks for the help!

I don’t think the MXP port is the same problem, a less severe problem but still has some issues. I could be wrong

Yeah I didn’t experience the rio crashing, but the color sensor just would stop responding, so it’s probably a good idea to not use the sensor unless you are doing something with the pi.

We are using the color sensor and it seems to have no issues. I made a example code just so it is less cluttered to look at. The code just uses proximity so you would need to add the get color functions. https://github.com/ClaytonM223/ColorSensorExample

It’s not the code that’s the problem in theory, it’s a problem with the firmware of the Rio or it’s hardware. It’s a strange bug as it occurs for some Rios but not others. It also seems to occur somewhat randomly, which is more confusing.

You probably got a lucky Rio that doesn’t experience this bug or you’ve just never encountered it.

1 Like

Our team has not had a single issue. could it have anything to do with using a v1 or v2 Rio?

You can see the thread linked in the solution or this one https://docs.wpilib.org/en/stable/docs/yearly-overview/known-issues.html. The conclusion as far as I know right now is that no one really knows what is causing the bug or why some people have it and others don’t.

This was just provided to me off CD by a mentor for a neighboring team. I’m with the same team as @anon37142155, but sharing with the wider audience.

Essentially, just reinstantiate the color sensor object when those 3 values return 0 (indicating a disconnect)

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