I’m a hobby programmer 6 months using Arduino after ten years of working Microchip PIC in assembler.
I’m looking for input on how to approach projects more complex than a simple void loop().
I’m working on a maze solving robot performs three tasks:
the maze is black tape on white board.
The first task is to solve the maze. The robot is placed somewhere on the board and travels until the goal is reach. Every time the robot passes over a maze junction it saves its decision in a character string. The decisions include, turn right (R), turn left (L), go straight (S), turn around at a dead end (B).
The second task is to simplify the course. An algorithm takes the course character stream and removes all dead ends or other unnecessary turns.
The third task is to run the same course in the most efficient manner. The robot is placed back at its starting point. Each time it passes over a maze junction it performs the next decision based on the next optimized string character.
At the end of the last task the robot should come to a stop. I’m using a long delay statement.
Each of these tasks involves its own set of primary and secondary functions.
My current approach has been to leave the current task by calling the next. This method should result in the program never returning to the first step of void loop function. But it is going back before completing the last task.
Where do I find theory or approaches for such sequential programs?