1

I am using an EV3 robot.

Is there a way to program it using a switch, or another way, to compare multiple colors?

The goal is to have the robot act as a car and use the color sensor to recognize red to stop, yellow to slow down and green to go in any given order.

Thanks!

1

Yes, a switch statement is present in EV3-G. Such statement would look like this: enter image description here

However, the only colors you can switch against are black, blue, green, yellow, red, white and brown (the basic lego colors). So unfortunately no orange.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.