Programming autonomous mode

So me and my team are trying to find a way to program autonomous mode. I’m trying to find out how what code we can use so that the robot only stops when a ring is right in front of it. Do you know how you can code it so that it only stops turning when the ring is right in front of it? If yes, both block and text code is wanted. If not, can you tell us some ideas?

If you want the robot to stop under any circumstance that a ring is in front of it, the code depends on what sensors you have on your robot. If you have an optical sensor in the front, you could stop when it detects something close. You could also use a limit switch or a bumper (But I wouldn’t recommend it). If you want the robot to drive to a ring, moving forward for a specific distance will do just fine.

Thanks for the idea, but i meant for it to find a ring on its own, or do I just have to use individual motion lines instead?

Not sure what you mean by finding the ring on its own. Do you mean pathfinding to a ring? I haven’t seen any teams do that, but you could try it using a Vision Sensor. But I don’t see the point of pathfinding other than the extremely specific. The rings will always be right where they’re supposed to be.