I’m a beginner and trying to write a code for a horse race derby game (made out of wood). There are two horses and each is driven by a 360° servo. Each horse is connected to three different sensors. Depending on which sensor is activated the horse should walk 1, 2 or 3 steps, what means, that the servo should make 1, 2 or 3 full rotations. I already wrote a working code using long delays to run the servos. But with this solution there are some issues: Its not possible that both horses walk at the same time and i don’t know how to make the horses return at the exact start position after one player one (one horse arrived at the end of the runway) at this moment the servos should rotate backwards, but each one individually. I thought I could place sensors at the start end the end of the runway, but they wont be activated during the delay.
I’m thankful for every input!