Lesson Plan: Week 11
In Week 11 we will do the following (please, click on the Segment links below to access the course materials):
Homework 10: Program a simple version of the game 'pong' on the 8x8 display
Goal: Learn to program a dynamic process at the example of the classic computer game Pong.
Set-up: Connect the the 8x8 display to the Arduino (this is the same set-up as for Homework 9). Then add a potentiometer to one of the two remaining analog pins.
Programming: Start out with your Homework 9 sketch. Add code for a 3 pixel wide 'paddle' on one side that can be moved left/right or up/down with a potentiometer. Program code that detects when the ball hits the paddle and reflects it back from the paddle.
If you are really into it, add the LCD display and show a score, adding a point for the Arduino when the ball gets behind the paddle and one for the player when the ball is bounced back from the paddle.
External Interrupts: Watch our video about using external interrupts.
Pong computer game: See here for a demo of the original game. The original single-player game is more complex than what you will do for this homework since the computer controls a second paddle.
To get credit: Come to class on the due date and present your working set-up to one of the TAs or Instructors.