VexCode Pen Color Change in a Loop?

Hello!

I was looking at lists and variables for this, but both seem to only accept numbers, not text.

Is there any way to change the robot pen color in a loop, like first t me through the loop then pen color is red, the next time through the loop pen color is blue, then green… etc…??

Thanks!
Jess

You could define a function like this that maps numbers to colors:

Screen Shot 2020-09-24 at 10.48.03 AM

Then call SetColor in a loop, passing different numbers to it.

7 Likes

Oh wow!!! Wish I would have thought of that!!! :O) Thanks so much for the quick response!!! :grin::+1::+1::heart:

1 Like