Playing Games on LCD Keypad Shield LCD1602
by Hannibal68 in Circuits > Arduino
352 Views, 3 Favorites, 0 Comments
Playing Games on LCD Keypad Shield LCD1602
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
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)))
Downloads
Uploading Game
I have made the following games which can be downloaded from Github.
- Guess the number
- Simon says
- Black Jack
- 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:
- #include <LiquidCrystal.h> (standard)
- #include <LCDKeypad.h> (standard)
- #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
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
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:
- Deal/hit card
- Double bet if you have enough money
- Pass/stand
- Surrender (loose half the bet)
- Split at the start if you have enough money (no double)
YATHZEE
YATHZEE
This is a 5 dice game. You have to fill a couple of series dice in 13 throws:
- numbers 1 till 6 (when total more than 63 you get 35 bonus)
- Three of a kind (total of 5 dice with at least 3 numbers equal)
- Four of a kind (total of 5 dice with at least 4 numbers equal)
- Full House (25 pt, 3+2 equal numbers)
- Little street (30 pt, 4 numbers on a row)
- Great street (40 pt, 5 number on a row)
- Yathzee (50 pt, 5 equal numbers)
- 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:
- up = select dice and go to next dice (dice inverted)
- down = unselect dice and go to next dice
- left, right = move cursor against dice
- select = throw dices or make choice after 3 throws (choose with up, down, left, right)