Skip to the content of the web site.

Project 4

The purpose of this project is to learn about dealing with interrupts and other peripherals.

  • Each time the button next to the reset is pressed, a new task is created and that task controls the movement of a ball on the screen.
  • You will use the potentiometer, which has a voltage range of 0.0-3.3 V, in order to control the speed of the animation.
  • You will record the number of balls on the screen by displaying a number in binary on the eight port LED.

In all of the figures, we show the background color slightly different from the ball icons. This is to indicate an appropriate approach; however, when you implement this, both the background of the icon and the general background should be the same color.

It is suggested that you first start with squares moving on the screen, as shown in Figure 1. Then, later, worry about creating balls, as shown in Figure 2.


Figure 1. The game with squares.


Figure 2. The game with circles.

You are required to implement at least one of the following features:

  • Use the joystick to create the new tasks, but allow the user to nudge the current ball with the joystick movements.
  • Make the background of the balls transparent with respect to other balls (see Figure 3).
  • Have the balls appear to "roll" by making them appear as beach balls (see Figure 4).
  • Having the balls ricochet off each other (see Figure 5).
  • Having the balls disappear if they touch (see Figure 6).
  • Anything else you may want (check with Laboratory Instructor).

It does not matter which feature you choose.

If you implement more than one feature, you will receive up to 10 % bonus on this project. The bonus will depend on the difficulty of the additional features.


Figure 3. The game with transparent icons.


Figure 4. The game with rolling balls.


Figure 5. The game with ricocheting balls.


Figure 6. The game with disappearing balls.