Articles

Arduino Game Project: Pong Game using an Arduino Uno and Color OLED display (SSD1331). Easy tutorial

September 19, 2019


Dear friends welcome to another video! Today we are going to build a Pong Game project
with Arduino and a color OLED display. There is a lot to cover so let’s get started! Hey guys, I am Nick and welcome to educ8s.tv
a channel that is all about DIY electronics projects with Arduino, Raspberry Pi, ESP8266
and other popular boards. In this video we are going to build an Arduino
powered Game. It is the classic Pong Game! I am now playing against the computer controlling
the green paddle. Each time a player scores, the score is displayed
on the screen. The first player to reach 8 points wins! It is a fun project to build and as you are
going to find out, it won’t take you more than 10 minutes to build it. Let’s start! The parts needed in order to build this project
are the following: • An Arduino Uno, Nano, Mini or Mega
• A 0.96” Color OLED Display • A breadboard
• Two Buttons • Some wires
The cost of the project is around 15$. You can find links for all the parts I use
in the description of the video below. Let’s now connect all the parts together. At first we place the screen and the buttons
on the breadboard like this. We then connect all the grounds to the breadboard’s
negative rail. Then, we connect the negative rail of the
breadboard to Arduino GND. Now, let’s connect the display. I have prepared a detailed tutorial about
this display, you can watch it by clicking on the card here! Vcc goes to 3.3V of the Arduino Uno, SCL pin
goes to Digital Pin 13, SDA pin goes to digital pin 11, Reset Pin goes to Digital Pin 9, DC
pin goes to digital pin 8 and lastly CS pin goes to digital Pin 10. The next step is to connect the left button
to digital pin 3 and the right button to digital pin 2. If you wish to learn how to connect a button
to Arduino without a resistor you can watch the detailed tutorial I have prepared on that
by clicking on this card. Now we are ready to power up the project. At first, the project displays a splash screen
with some custom graphics. Then if we press any button the game begins. We can move the green paddle down by pressing
the left button and UP by pressing the right button. The first player to reach 8 points, wins. Then the score is displayed and we have to
press a button in order the game to restart. Nice, isn’t it? Let’s now take a quick look at the code. The code of this project is based on the code
of a pong game for the monochrome OLED display. You can find the link for the original code
in the description of the video below. I modified the code to work with the color
OLED display, I added the splash screen, and the score, and the game Over screen. The project needs two libraries in order to
compile. We need the Adafruit GFX library and the library
for the OLED display. By adjusting the values of these variables
you can change the difficulty of the game. You can set the ball speed, the paddle speed,
the paddle height and the maximum score in order to make the game fit your taste. That’s it, upload the code to Arduino and
have fun! As always you can find the code of the project
and links for the libraries in the description of the video below. That’s today’s project. An Arduino Pong game with a color OLED display. It is an easy project to build and it can
be further improved. We can design and 3D print an enclosure for
it. Since the display is so small I think it won’t
be playable, so I plan to write the game again to support a bigger display. I would to hear your opinion about this. Do you want to build a similar game with a
bigger screen, and if yes which screen do you prefer? Please vote your favorite screen by clicking
on this card here. Thank you for your feedback! If this is your first time here, I would love
to have you subscribed. In this channel I post videos about DIY projects
every Saturday. I love making things and I believe that anyone
can make things, anyone can become a maker. That’s why I created this channel, in order
to share my knowledge with the community and learn from the community. I hope you will join us. Until next Saturday, Watch, Learn, Build! [ Translating these subtitles? Add your name here! ]

You Might Also Like

No Comments

Leave a Reply