Lesson Plan: Week 10
In Week 10 we will do the following (please, click on the Segment links below to access the course materials):
All students submit a short (< 2min) video showcasing their progress with the building of the mechanical parts of their projects. At this point the implementation of a first prototype of the mechanical parts needs to be completed.
Homework 9: Show a bouncing dot on the 8x8 LED display.
Goal: Understand how to use timer interrupts and the 8x8 LED display. Learn how to show dynamic content on the display.
Set-up: Connect the the 8x8 display to the Arduino.
Programming: Start out with the provided sketch for the 8x8 display. Then write code that shows a 'ball' (single illuminated LED) that bounces back every time it hits one of the fringes of the display. Introduce some randomness into the bouncing-back angle to introduce changes in the path of the ball. This can be done by using the random() Arduino method (see Arduino reference). You can also change the speed of the ball every time it bounces back using this method.
Watch our 8x8 display and timer interrupts video posted here. It explains how it works, how to set-up a timed interrupt. Start with the provided sketch and then add your bouncing ball code to the main loop and enjoy the display updating itself via the timed interrupt.
To get credit: Come to class on the due date and present your working set-up to one of the TAs or Instructors.