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.