Autonomous roller code question

We’re trying to use an optical sensor to control our roller turning in autonomous and are running into issues. The code below is our function call in void autonomous:

and this is the function itself:

When we run this in autonomous the LED turns on, but otherwise it doesn’t do anything (the sensor is seeing red at first, so it should be moving until the red is on the other side of the roller). We’ve checked and our sensor can detect the colors on the roller. When this same function is called under an if buttonX.pressing during driver control, it works as intended.

comparing Optical.hue() to Color ?


Sorry, we tried switching it to Optical.hue() because we thought it might fix the problem, but it didn’t work so we switched back to color. It looks like we missed one instance, thanks for catching it