DIY retro pong game that fits in your pocket

  Рет қаралды 12,594

Programming Electronics Academy

Programming Electronics Academy

Күн бұрын

🤩 FREE Arduino Crash Course 👇👇
bit.ly/get_Arduino_skills
Want to learn more? Check out our courses!
bit.ly/2WtFxuw
**Get your Free Trial of Altium PCB design Software**
www.altium.com/yt/programming...
**Get the code, transcript, challenges, etc for this lesson on our website**
bit.ly/3jjqFI0
We designed this circuit board for beginners!
Kit-On-A-Shield: amzn.to/3lfWClU
FOLLOW US ELSEWHERE
---------------------------------------------------
Facebook: / programmingelectronics...
Twitter: / progelecacademy
Website: www.programmingelectronics.com/
**About Us:**
This Arduino lesson was created by Programming Electronics Academy. We are an online education company who seeks to help people learn about electronics and programming through the ubiquitous Arduino development board.
***We have no affiliation whatsoever with Arduino LLC, other than we think they are cool.***Want to learn more? Check out our courses!
Check out this retro pong Arduino game built with an Arduino UNO microcontroller development board! We have included the Arduino code and circuit digram at the bottom of this post so you can easily build this yourself too.
Steve Stefandis, who does technical writing for PEA, designed this really fun retro pong game with 5 components (OK and a resistor too!), and I think you’ll get a kick out of how it works!
THE BUILD
Pong Arduino game on proto-shield
Steve used an Arduino nano for his design, when I built it , I ended up using an Arduino UNO with a proto-shield on top - if you have no idea what an Arduino is, or what an Arduino shield is, make sure to check out our our other KZfaq videos that go into all those kind of details.
Those shields can come in handy, because it has a built in solderless breadboard for prototyping something small right on top.
The display for this is an OLED module. You can pick these up anywhere, I got mine on amazon. These things are super cheap and pretty easy to use with the graphics libraries out there - Steve used the u8glib library for this project.
A piezo buzzer is for adding sound effects for when the ball hits the paddle, wall, and when you lose. I was impressed with the buzzer noises, coming from a simple piezo buzzer - they sound pretty good! It really reminds me of an old school game.
The last part is a rotary encoder. This is the dial that allows you to move the paddle back and forth - you can also press down on the dial, and this acts as a button that is used for adjusting different settings which I show you in a moment.
Rotary encoders are great for building interfaces with limited space, where you need to make selections. With the right code you can track exactly where the shaft is any given time. If you are ever interested in learning how to program these, we have an entire course at PEA that covers how to write code to use these - you learn a bunch about interrupts in the process - it’s pretty cool!
This rotary encoder comes attached to a PCB base making it breadboard friendly. Again, this is all stuff you can easily get on amazon or any electronics vendor for that matter.
That’s pretty much it for components of this pong Arduino game, save a single 100Ohm resistor for the piezo buzzer.
ARDUINO PONG GAME PLAY
I already uploaded the code onto the Arduino board, so once this is powered up you start playing immediately.
pong Arduino game OLED display
You’ll notice when I first built this, to my surprise I had used an OLED display that had a yellow only bar at the top. So the whole top quarter of the screen is yellow, and the bottom half is blue. I ended up really liking the 2 tone look - it sort of reminded me of a glitch I might see on some old arcade
CONTINUED…
bit.ly/3jjqFI0

Пікірлер: 37
@michaelcheich2481
@michaelcheich2481 2 жыл бұрын
Would you like us to explore this project in more detail?
@ChadKapper
@ChadKapper 2 жыл бұрын
Yes - please do another video digging into the code!
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks Chad - note taken!
@rks2307
@rks2307 2 жыл бұрын
Man I can't believe how simple that design is! So few wires, only a few components... Awesome! Thanks for the video!
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks for watching!
@emilycheich3741
@emilycheich3741 2 жыл бұрын
Super fun idea, especially for DIY gaming enthusiasts!
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks! Glad you like it!
@voltamon8610
@voltamon8610 2 жыл бұрын
@Programming Electronics Academy Please help me remove the settings menu from the code, I want the rotatory encoder single press to pause the game and resume the game and not showing the settings menu. I want to initialise a constant size, sound volume, skew & speed. Please help me sir. Btw the video is great
@krishnawa_
@krishnawa_ 2 жыл бұрын
I am one of the member of programming electronics academy and the rotary encoder series was really useful.Especially I don't know why Gray code is used but now I am, can you make a series like this in the video from the scratch, I'm very curious about the how he applied the physics in the Arduino
@programmingelectronics
@programmingelectronics 2 жыл бұрын
I'm glad you liked the rotary encoder course - one of my favorites as well Krishna! I'll see what we can put together for the code demo of this!
@krishnawa_
@krishnawa_ 2 жыл бұрын
@@programmingelectronics btw today I was trying to make the rotary encoder program as a library I hope within 2 days I'll complete it
@michaelcheich2481
@michaelcheich2481 2 жыл бұрын
Very cool! I look forward to checking it out @@krishnawa_ !
@GHILLIESARCADEANDMORE
@GHILLIESARCADEANDMORE 2 жыл бұрын
I have looked at a couple of those pong games would I'd like to know is how to hook it up to a bigger screen
@programmingelectronics
@programmingelectronics 2 жыл бұрын
I _think_ the graphics library can handle larger screens.
@Abdurrahman24251
@Abdurrahman24251 Жыл бұрын
your code works fine but my display dose not show anything but my buzzer beeps so i know other things are working fine but can you help me
@kimberlyjacobsen4148
@kimberlyjacobsen4148 Жыл бұрын
Do a updated version with a motorized potentiometer
@programmingelectronics
@programmingelectronics Жыл бұрын
I'll see what we can do, thanks for the recommendation!
@GANCFLEX
@GANCFLEX 2 жыл бұрын
cool video :D
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Glad you like it! Thanks!
@moonmatthew
@moonmatthew 2 жыл бұрын
Could this be Made with a button and a 10k potenciometer?
@programmingelectronics
@programmingelectronics 2 жыл бұрын
I think it "could" be made with a potentiometer, but I think it be tough with getting the timing to work out. The rotary encoder code is using interrupts to update the position of the paddle, with a pot I think you'd have to be polling the analog pins, which might make it not as responsive. Might be a fun challenge to try though!
@Horns-knowledge
@Horns-knowledge 2 жыл бұрын
Creative
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Thanks so much!
@konektronik3282
@konektronik3282 2 жыл бұрын
Code doesn't compile successfully. I meet this error (among others) in many lines : pong:81:23: error: request for member 'activeValue' in 'params', which is of non-class type ' [5]' allowSound = params.activeValue; // sets sound on/off
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Sorry about that, It has to do with how the code is rendered on the website and copied (it is adding hidden characters), if you download the sketch file it should work fine
@konektronik3282
@konektronik3282 2 жыл бұрын
Thanks !
@technicaltapir9741
@technicaltapir9741 2 жыл бұрын
Cool, now someone have to explain the code :D
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Definitely! We are considering a follow on that dives into the code.
@inspiredtiny
@inspiredtiny 2 жыл бұрын
The code doesn't work.
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Are you getting an IDE error?
@programmingelectronics
@programmingelectronics 2 жыл бұрын
The code issue may have been how we had the code embedded on the website. I have added a link to the post to download the sketch. I hope this helps!
@inspiredtiny
@inspiredtiny 2 жыл бұрын
@@programmingelectronics I've finally figured out what is going wrong.. Your code is perfect.. the problem is my library.. I'm so used with the "u8glib" I thought it's the one your code needs..which is not... It turned out there is a "U8glib". Now, all is great!
@inspiredtiny
@inspiredtiny 2 жыл бұрын
Thank you!
@dinuthfernando3217
@dinuthfernando3217 2 жыл бұрын
first comment
@programmingelectronics
@programmingelectronics 2 жыл бұрын
Second comment!
@dinuthfernando3217
@dinuthfernando3217 2 жыл бұрын
@@programmingelectronics please sir can I contact you
@dinuthfernando3217
@dinuthfernando3217 2 жыл бұрын
@@programmingelectronics i am your best student not fan
Which Arduino IDE should I use?
13:43
Programming Electronics Academy
Рет қаралды 84 М.
Improving the $10 8-bit handheld game console
14:21
Adrian's Digital Basement
Рет қаралды 172 М.
Inside Out Babies (Inside Out Animation)
00:21
FASH
Рет қаралды 21 МЛН
ВОДА В СОЛО
00:20
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 32 МЛН
Using Arrays with Arduino
13:51
Programming Electronics Academy
Рет қаралды 29 М.
Try these 16 Brilliant ESP32 projects!!!
11:18
ToP Projects Compilation
Рет қаралды 559 М.
Build your own auto-ranging Ohmmeter! (with Arduino)
11:10
Programming Electronics Academy
Рет қаралды 19 М.
If you don’t learn sprintf(), your code will hate you later
8:34
Programming Electronics Academy
Рет қаралды 50 М.
Top Fifteen Mistakes People Make When Designing Prototype PCBs
12:26
Cosplay Light and Sound
Рет қаралды 141 М.
Control your keyboard with Arduino!  Automate simple tasks!
22:48
Programming Electronics Academy
Рет қаралды 65 М.
I found PERFECT display
51:32
upir
Рет қаралды 561 М.
What is the ? code!?  Learn about the ternary operator!
12:30
Programming Electronics Academy
Рет қаралды 12 М.
DIY Famicom: Building an Amazing Sound Retro Game Console
4:23