4. Led Pong‎ > ‎

1. The Approach

The main challenge was how to make a ball (a pixel, single LED of a LED Matrix) bounce the walls of that box in the following way:

To accomplish that, we need to study the motion above.
If you look at it carefully, you will find that the ball is actually in a 2 Dimensional motion.
So we can break the motion in x-axis and y-axis.
This can be seen in the animation below:

Looking at only one axis at a time, we can see that when the ball reaches the end of that particular axis, the direction  of that axis is inverted i.e. if the ball is going right and it reaches the wall, it starts going left and back again. Just as the animation below:

Considering that the above square is actually an LED Matrix, we need to make a circuit for a LED Chaser (remember Knight Rider, the front of the car had something similar to a Led Chaser). One Led Chaser circuit for x-axis and another for y-axis. We can then feed this axis data to the Led Matrix's x and y inputs.