Project tutorial
How to make Arduino Pong Game-Arduino Project

How to make Arduino Pong Game-Arduino Project © GPL3+

Complete step by step guide how to make Arduino pong game. You can play pong game with the computer with a green paddle.

  • 4,063 views
  • 1 comment
  • 4 respects

Components and supplies

About this project

Arduino projects

In this project, we will learn how to build Arduino pong game with UNO and Oled color display screen. The Pong game is the very easiest arcade game. Now you can make it with Arduino; you can play with the computer.

User Also Read:

Getting Started with Raspberry Pi3.

DIY Arduino Voltmeter.

You can play towards the laptop through controlling the touch button. Every time a participant rankings, the score displayed on the Oled screen. The first player to attain eight points to wins! It’s far a fun mission to build and as you’re going to find out, it won’t take you more than 10 minutes to make it. Let’s start.

Arduino pong game step by step guide:

For Arduino pong game project we need Arduino UNO or Mega 2560, it is your choice. One color OLED display, A breadboard, Two touch button to play game one for the right side other for the left side.

List of required components:

  • Arduino Board (Any) $5
  • OLED Display $10
  • Two Buttons
  • 1x breadboard
  • jumper wires

The cost of this project is around about $17 max however you can use Arduino Nano board to make it more compatible in size to fit in the box and inexpensive.

Wiring:

Now connect all components together. At first, we will connect display and buttons on the breadboard then connect all the ground to negative rail on the breadboard then connect negative rail to Arduino GND pin with jumper wires.

OLED Connections:

GND to the Breadboard negative rail.

Vcc to Arduino 3.3V of the Arduino.

SCL to Digital Pin 13 of the Arduino.

SDA to Digital Pin 11 of the Arduino.

Reset to Digital Pin 9 of the Arduino.

DC pin to Digital Pin 8 of the Arduino.

CS pin to Digital Pin 10 of the Arduino.

Now next step is to connect left button to digital pin3 and right button to digital pin2. We made all the connection of components now the final step is to upload the code to Arduino board. Read below for the Source code of this project.

Code for Arduino pong game project:

Now the final step is to upload the code to Arduino board to play pong game. You need two libraries for this project to work code correctly.

Step 1: Download Adafruit GFX library from here.

Step 2: Download Color OLED Library from here

Step 3: when you download the both libraries from the above links now you have to install them on your Arduino IDE. If you don’t know how to install libraries on Arduino IDE tools, No need to worry. Just follow Step 4 and 5.

Step 4: Open Arduino Goto Sketch then select Include Library from the scroll down menu.

Step 5: Select Add.zip Library give the library zip file path which you have download. That’s it.

Step 6: When you successfully installed libraries now you need to upload Main code to Arduino board. You can find the code from here.

Now you have done everything give power to Arduino and enjoy the Most famous PONG GAME on your Arduino 😀

NOTE: If you want the modification to the game like ball speed, score limit, you have to change some values from the below code.

uint8_t ball_x = 64, ball_y = 32;
uint8_t ball_dir_x = 1, ball_dir_y = 1;
 
boolean gameIsRunning = true;
boolean resetBall = false;

If you like my work must comment below and share with others. For any question OR help drop comment below 🙂

Code

Code snippet #1Plain text
uint8_t ball_x = 64, ball_y = 32;
uint8_t ball_dir_x = 1, ball_dir_y = 1;
 
boolean gameIsRunning = true;
boolean resetBall = false;
Github
https://github.com/adafruit/Adafruit-SSD1331-OLED-Driver-Library-for-Arduino
Github
https://github.com/adafruit/Adafruit-GFX-Library

Comments

Similar projects you might like

Serial Pong

Project showcase by Cody Brooks

  • 2,803 views
  • 2 comments
  • 12 respects

NeoMatrix Arduino Pong

Project tutorial by Arduino “having11” Guy

  • 4,650 views
  • 0 comments
  • 19 respects

ARDUINO PONG

Project tutorial by raul

  • 1,823 views
  • 1 comment
  • 8 respects

RING PONG

Project showcase by aerodynamics

  • 5,679 views
  • 2 comments
  • 14 respects

Arduino Ping Pong Pinball

Project tutorial by joesinstructables

  • 4,839 views
  • 4 comments
  • 10 respects

Arduino Pong With TV Output

Project tutorial by Team RobotGeek Projects Team

  • 4,724 views
  • 2 comments
  • 14 respects
Add projectSign up / Login