Playing Games on LCD Keypad Shield LCD1602

by Hannibal68 in Circuits > Arduino

189 Views, 2 Favorites, 0 Comments

Playing Games on LCD Keypad Shield LCD1602

Perspective11.jpg

My goal was to make different games on this LCD keypad shield. It is a ready to use shield which can be put on a standard arduino uno. Plug in the USB power cable and you are ready to go after uploading a program.

Supplies

IMG_4394.JPG
Buzzer.jpg
LDR.jpg
LCD-keypad back.JPG
LDR arduino.JPG

The only thing you need is the LCD keypad and an Arduino Uno.

If you have a 3D-printer you can print a case for the Arduino+LCD-keys.

For more game fun I added a standard buzzer to pin 12 and ground

For better randomizer I added a LDR (photo-resistor) to analog pin 2 (randomSeed(analogRead(2)))

Uploading Game

I have made the following games which can be downloaded from Github.

  1. Guess the number
  2. Simon says
  3. Black Jack
  4. Yathzee

https://github.com/Hannibal68/Arduino-games.git

The keys (select, left, up, down, right) are used for selection your choice. With reset you reset the arduino and you have to start from the beginning.

The following libraries are used:

  1. #include <LiquidCrystal.h> (standard)
  2. #include <LCDKeypad.h> (standard)
  3. #include "Zoemer.h" (added on github)

You can upload the games using the standard Arduino IDE from https://www.arduino.cc/en/software

SIMON SAYS

Image_SS_00.JPG
Image_SS_01.JPG
Image_SS_02.JPG
Image_SS_03.JPG
Image_SS_04.JPG
Image_SS_05.JPG

SIMON SAYS

This is an old memory game with repeating serie where each round a sign is added. After showing the serie you have to repeat the exact order with the 4 corresponding keys.

BLACK-JACK

Image_BJ_00.JPG
Image_BJ_01.JPG
Image_BJ_02.JPG
Image_BJ_03.JPG
Image_BJ_04.JPG
Image_BJ_05.JPG

BLACK-JACK

The second game is black-jack, playing by the official rules with one stock.

You start with $200 and to win from the bank you must reach $1000 (changeable in program)

Options:

  1. Deal/hit card
  2. Double bet if you have enough money
  3. Pass/stand
  4. Surrender (loose half the bet)
  5. Split at the start if you have enough money (no double)

See also: https://www.blackjack.org/blackjack/guide/

YATHZEE

Image_YZ_00.JPG
Image_YZ_01.JPG
Image_YZ_02.JPG
Image_YZ_03.JPG
Image_YZ_04.JPG
Image_YZ_05.JPG
Yathzee score.jpg

YATHZEE

This is a 5 dice game. You have to fill a couple of series dice in 13 throws:

  1. numbers 1 till 6 (when total more than 63 you get 35 bonus)
  2. Three of a kind (total of 5 dice with at least 3 numbers equal)
  3. Four of a kind (total of 5 dice with at least 4 numbers equal)
  4. Full House (25 pt, 3+2 equal numbers)
  5. Little street (30 pt, 4 numbers on a row)
  6. Great street (40 pt, 5 number on a row)
  7. Yathzee (50 pt, 5 equal numbers)
  8. Chance (total of 5 dice)

Choose your numbers, press select button, after 3 throws you have too choose one of above. The program checks the points and add these tot your total. The numbers (1) are inversed when used and the others (2-8) are capital when used. The (b) stands for bonus 35 if it turns to (B). If you make an illegal choice a sound beeps. You have to make 3 throws, you cannot quit after 1 or 2 throws (hint: select everything). Everything fits exactly on one screen.

Used keys:

  1. up = select dice and go to next dice (dice inverted)
  2. down = unselect dice and go to next dice
  3. left, right = move cursor against dice
  4. select = throw dices or make choice after 3 throws (choose with up, down, left, right)