I am making a maze navigating robot for a school project and need help... I can't make it turn as it needs to. I have attached a diagram of the maze and a copies of the two different codes I having been trying to use..
Maze Diagram.pdf (127 KB)
5C_AutoSparkBot.ino (7.02 KB)
Test_2.ino (6.64 KB)
You need to describe your problem better.
For a given sketch, describe what you expect the result to be.
Describe what actually happens.
Describe how those two differ.
OK...
When the robot senses there is something in the way, I expect it to turn left, and check whether the path is clear. Then, if the path is clear, move forward. However, if the path is not clear, it should do a 180 degree turn so it is facing right, and check whether the path is clear, and if it is, move forward.
What happens is that it always just turns left, and refuses to turn right any time or it turns left and then right straight away, meaning that it is on the same heading as before.