Quantcast
Channel: Blogs at All About Circuits
Viewing all articles
Browse latest Browse all 742

DIY Pong - Part 4 of 4 - The Play

$
0
0
This is the final part of my four-part DIY Pong blog.
We now have all the ingredients in place to wrap this up. We have bats and a ball. Let's play ball.

Single Player Mode
To make things simple, let's begin with a single player game. We detect when the ball hits the paddle by ANDing the ball position with the paddle position. The output of the AND gate is stretched by a monostable multivibrator to about 1ms. The ball direction is switched by toggling the square wave generator at U9A.

Collision between the ball and left paddle triggers a positive going pulse at U13A, pin-6. Diode D1 is forward biased and pulls the non-inverting input of U9A above the reference voltage at the inverting input. This switches the direction of the ramp.

Collision between the ball and the right paddle triggers a negative going pulse at U13B, pin-9. Diode D2 is forward biased and pulls the non-inverting input of U9A below the reference voltage. This switches the ball motion to the opposite direction.

Ball rebound circuit
ball rebound schematic.jpg

Single Player Demo



Breadboard Circuit

The complete circuit is now on the breadboard.
pong004.jpg


Two Player Demo



It has been a lot of fun putting this together in a matter of a few evenings over one week. I hope you enjoyed seeing the progress as much as I have in putting it all together.

Thanks for watching!

Viewing all articles
Browse latest Browse all 742

Trending Articles