Distance sensor troubles

We are having lots of troubles with our distance sensor. The code is fine. It works and then it doesn’t work. The distance sensor is to turn until it sees something less than 15 inches away, then stop, and then go forward until less than 2.5 inches away. Stop and then write the color on the brain and count.

Hi @Maria_Brinza! I’m sorry to hear you’re experiencing problems. To best help and understand the problem, could you send me a video of the robot not behaving as intended?

Could you also show me some images of the code you’re trying? This will help to better identify potential issues :slight_smile: