Hello! I am from FTC team 11289, and we are having trouble programming our color sensor. We want our robot to drive until it either sees the yellow mineral, or goes 20 inches. We already have the color sensor working in another program that just shows the color readout over telemetry, and our movement works great too. We just don’t know how to use the loop that would work. “hsvValues” is the Hue of HSV. We got it by using the Color.RGBtoHSV function for the RGB output of the color sensor.
right.setPower(.5);
left.setPower(-.5);
while (hsvValues[0] < 30 || hsvValues[0] > 35 || right.getCurrentPosition() > 140 * 20){
idle();
}
right.setPower(0);
left.setPower(0);
What are we doing wrong.