Rock Paper Scissors Game Using Arduino Nano and OLED

by DESHBOT in Circuits > Arduino

27 Views, 0 Favorites, 0 Comments

Rock Paper Scissors Game Using Arduino Nano and OLED

WhatsApp Image 2026-09-21 at 10.45.59 AM.jpeg
WhatsApp Image 2026-09-21 at 10.46.23 AM.jpeg
WhatsApp Image 2026-09-21 at 10.46.05 AM.jpeg

The objective of this project is to create a simple Rock Paper Scissors game using an Arduino Nano, an OLED display, and two push buttons.

The player can select Rock, Paper, or Scissors using one button and press another button to play against the computer.

Supplies

des 1.jpeg
oled.jpeg
uno.jpeg

Arduino Nano

0.96-inch OLED Display (128×64, I2C)

2 × Push Buttons

Jumper Wires

DESHBOT Shield

USB Cable

Pin Connections


ComponentArduino Nano

OLED SDA - A4

OLED SCL - A5

OLED VCC - 5V

OLED GND - GND

Change Button - D10

Play Button - D12

The buttons use the Arduino's internal pull-up resistors, so an external resistor is not required.

Working Principle

WhatsApp Image 2026-09-21 at 10.46.34 AM.jpeg


The game has three choices:

  1. 0 = Rock
  2. 1 = Paper
  3. 2 = Scissors

Change Button — D10

When the D10 button is pressed, the player's choice changes:

ROCK → PAPER → SCISSORS → ROCK

The OLED displays the current selection.

Play Button — D12

When the D12 button is pressed, the Arduino randomly selects one of the three choices for the computer.

The OLED then displays:

YOU: ROCK
CPU: SCISSORS

YOU WIN!

The Arduino compares both choices and determines the result.

Game Rules

The normal Rock Paper Scissors rules are used:

PlayerComputerResult

Rock

Scissors

Player Wins

Paper

Rock

Player Wins

Scissors

Paper

Player Wins

Same Choice

Same Choice

Draw

All Other Combinations


Computer Wins

Program Features

  1. 128×64 OLED display
  2. Two-button control
  3. Three selectable choices
  4. Random computer choice
  5. Automatic winner detection
  6. Draw detection
  7. Simple game interface
  8. Uses INPUT_PULLUP for the buttons
  9. Uses Arduino's random() function for the computer


Downloads

Conclusion


The Rock Paper Scissors project demonstrates how an Arduino Nano can combine buttons, OLED graphics, random numbers, and conditional programming to create an interactive game.

It also demonstrates the use of if, else if, functions, variables, and random number generation in an Arduino-based embedded project.