Play a PONG Game With Arduino Uno and OLED 0.96 SSD1306 Display

by Utsource in Circuits > Arduino

12207 Views, 8 Favorites, 0 Comments

Play a PONG Game With Arduino Uno and OLED 0.96 SSD1306 Display

Screenshot_20190909-064418__01.jpg
Hi guys today we will be making a PONG Game with Arduino. We will be using adafruit's 0.96 oled display to display the game & push buttons to control the game.

Things You Need

Screenshot_20190909-064256__01.jpg

For this project you need following things :
1x Arduino uno : https://www.utsource.net/itm/p/9221687.html

2x push buttons

1x oled display 0.96 ssd1306 i2c : https://www.utsource.net/itm/p/9221021.html

1x breadboard :. : https://www.utsource.net/itm/p/8031572.html

Few jumpers : https://www.utsource.net/itm/p/9221310.html

Connect the Display to Arduino

Screenshot_20190909-064216__01.jpg
First you need to connect the display to Arduino.
Connect vcc to 5v.
Gnd to gnd pin.
Sda of led to A4 on Arduino & scl/sck of display to A5 on arduino.

Connect Push Buttons

Screenshot_20190909-064233__01.jpg
Now let's connect push buttons as well.
One end of both UP & DOWN button will be connected to Gnd and one end of UP button will be connected to pin 2 on Arduino & one end of DOWN button will be connected to pin 3 on Arduino as shown in the picture.

Download the Libraries

Screenshot_20190909-064327__01.jpg
Screenshot_20190909-064339__01.jpg
Make sure you downloaded SD1306 libraries in Your Arduino ide as shown in image and make sure you Adafruit GFX library as well, if not then install these two libraries.

Code

Screenshot_20190909-064403__01.jpg

Down the code from the given link & upload to your arduino uno.


Download code : https://github.com/shveytank/Arduino_Pong_Game

Final Step

Screenshot_20190909-064430__01.jpg
Screenshot_20190909-064418__01.jpg
Screenshot_20190909-064412__01.jpg
So we completed everything successfully and as you can see i am playing my Pong game in the image with the help of UP & Down push buttons. So make your own Pong game & have fun. So good luck making your own Pong game.