Repeat code until color is false

Hey there, i’m an absolute beginner, and was trying to set the RVR to repeat a code until the color read was different from the one set in the Event.

My carpet is gray, so i wanted it to remain within the carpet’s boundaries. For that i tried setting an event for gray color, to star moving at speed 20 with the lights on green. Then a couple of different ideas. I used an “if true then else”, “loop until false”. I wanted it to simply rotate 180 deg, change lights to red and start moving at speed 20 again. after a sec of moving again it would change the light color to green again.

I can get the RVR to start moving but it doesn’t seem to READ a new color under it.
Comparators don’t seem to allow color sensor data.

I know i can create a new event if it reads another color but i have to have previously read the color with the RVR. My plan was to keep moving forward until the color underneath it is “different” from gray.
If I create a new event for the color yellow for instance, then the rvr behaves as expected.

Any ideas on how to do this? This is the first time im actually looking into code, I understand there’s a difference in “while” and do while" etc… but since i dont know how to code is there a way of doing this with the blocks?

Thank you

1 Like

Hello @bbelmar, welcome to the forum!

Would you be able to post a picture of the code you are using? It would be easier for me to see what is happening!



1 Like