Pi Digits Quiz With Arduino

by sistemasymicros in Circuits > Arduino

1818 Views, 14 Favorites, 0 Comments

Pi Digits Quiz With Arduino

esquema_bb.jpg
Pi number quiz game

How mani PI digits can you name? It's PI day all month long and i wanted to p.ay tribute to it making this simple project. It is about a quiz game that consists in type as many PI digits as you can, thorough a keypad connected to arduino.

The game starts showing the "3.", so you only have to type the decimal part that you memorice. When you type a wrong digit, the game ends and shows your score and the time spent. I only remembered "14159265" (8 decimal spots), so, test how many can you?

The game scores one point for every correct digit you type.

Play video

Pressing the key 'A' starts a new game.

Diagram of the Project

esquema_bb.jpg
circuito_esquematico.png

LIST OF COMPONENTS:

  • Arduino One or another model.
  • Keypad (4x4) or (4x3)
  • Display lcd
  • Potentiometer of 50k
  • Breadboard
  • Jumpers for connecting.

The Arduino Code

digitos.png

You can download the code in arduino here.
When the game starts, the number "3" and the "." is shown in the lcd, so you have to begin to type the decimal part of the pi number. As you type the digits are shown in the lcd, when you press a wrong digit, the game ends and is shown your score and time spent ("mm:ss format"). You get a point for every correct digit.

Pressing the key 'A' starts a new game.

The logic of the game is simple, the digits that the player enters, are stored in an array and it is compared digit by digit as you type with the String array that contains the 100 first pi decimal digits.

if(cifra_jugador[count]==miPi.charAt(count)) {

//Actions

}

If you like this project for the pi day, please vote for me in the PiDay Contest. I will be very greatful.

If you have any comments, suggestions, please let me know it.