Lab 4: Line Following
This is an individual assignment!! Help a friend in need (help find coding errors) but don’t show you code to others! We want to be sure everyone has the full coding experience.
The Task:
(you may demo after school as well - 10 point deduction if demo done on Monday after break)
Program the Create to "race" the TEAMS Grand Prix track. The track is made of white foam board, with black tape creating the "roadway." Here are your design objectives...
- Create a program that follows your flowchart
- Demonstrate good debugging techniques
- Properly formatted and commented code
- Use of sensible visual or audio cues to interpret the execution stage of your program
- Use of your new 2x16 LCD display (thanks to Shanna, Jim, David, and Ven for helping with assembly!)
- Follow the roadway (in either direction)
- Can you negotiate the hairpin and right angle turns?
- Jim will add a red border to the track - those will represent the hay bales. Your robot should never go outside the hay bales.
- If you encounter another driver on the course, take appropriate action
- When program is started, wait for play to be pressed (blink it in the mean time)
- Only operate in "safe" conditions
- Set a two minute time limit for your robot to complete the course
- No infinite loops!!!
Bonuses: DON'T try these until your basic program works!!
- Can you handle intersections? Bonus if you can write code that will allow your robot to explore all portions of the track (it should't follow the same path each time). Hint: Explore these topics in the C reference materials we put on the Useful Links:
- random (pseudorandom) number genereator
- mod function
- case statement
- A second Bonus: If you start your robot off the raceway (between the track and the hay bales), can your robot find its way onto the road?
Your Lab Report Should include: due on day after Thanksgiving break for both cohorts
- A flow chart of the process your Create uses for line following
- A copy of your neatly formatted, well-documented code (print from WINAVR), color preferred
- A summary of your results for the lab (1 to 2 page max), including...
- How did your robot perform?
- If your robot had problems on part of the course, what caused the problem? If it was a coding problem, you should correct your code! If it is a physical limitation of your robot, explain the sitatuation (see next bullet)
- If there are inherent limitations with the Create for the course we laid out, explain exactly what those limitations are.
- If you could add on "stuff" (extra hardware) to the Create (yes, we can!!) to make the difficult parts of the course easier to navigate, what would you add?
- A list + the effectiveness of the debugging tools you used
- A brief list of the important lessons you learned
- FYI: if you need help getting started, here's a worksheet you can use to help step through the program (and it suggests some useful debugging tools)
Be patient and persevere!