Maze Navigation with QTIs

Jessica does a fantastic job explaining each step of the navigation. I have a question about the maze setup. She says,

"Although this code was written specifically for the maze shown in Figure 2 (previous section), it can be adapted to a variety of other situations as well as expanded for more complex mazes."

Why is this code specific to the maze in Figure 2? Why wouldn't it work for any maze with T intersections and dead ends (no loops)?

I have made maze sections on cardstock, and we usually piece them together for our line following. I have straight lines, turns, T-intersection (new for this project) and dead ends (new for this project). These are similar to the attached picture. Can I use these to make up a random maze, or does it need to look like the one in Figure 2? And I need to be able to explain why, cause there's always a kid that asks...

Thanks for your help! This is my fourth time teaching the class and it's getting so much better.


593 x 461 - 53K


  • Hi Diane

    The code for this example should work for other mazes that contain 90 left/right turns and T sections. She just means that you may or may not have to tweak your code depending on the complexity of you maze. If you enter a competition for example, it may have certain rules where you can only use 2 qtis or you have to finish the maze at a fast pace which means you would have to adjust your timing. If you are navigating a maze similar to the one shown or a maze with approximately the same amount of complexity then you won't have to make any changes to the code.
  • Thanks! I just wanted to double check. I hate when things go completely wrong in class. But whenever there's a major snafu, I remind them of the starting salary for programmers and engineers. It might be horribly frustrating at times, but it pays well!
  • I would also think she is referring to the width of the line. The maze in the demo has a very wide line and the code works well with it but at a lot of line maze competitions use lines only a 1/4 of an inch in width. You have to change the spacing on the QTI sensors and tweak the code quite a bit to get it to work on the smaller line.
Sign In or Register to comment.