Blackjack

Overview

This project implements a one-player Blackjack card game on the mbed microcontroller using the uLCD-144-G2 128 by 128 Smart Color LCD display board with a serial interface and 8 Parallax pushbuttons. The LCD display board shows the values of the cards that are dealt to the player (the user) and the dealer (the computer), and it shows the bet value that player selected. The LCD screen also prompts the player to continue playing if the player lost the round to the dealer. The player can also the follow the game, such as the money pot size, the player's hand, the dealer's hand, and directions for the player to follow, on a PC prompt screen. This project specifically uses Tera Term to show the player.

The 8 pushbuttons serve different purposes using the rules of Blackjack. 4 pushbuttons allow the player to select 4 different bet values: $0, $25, $100, and All in. 2 pushbuttons are used to hit, meaning to ask for another card, and stand, meaning to let the dealer play out after the player is satisfied with the player's cards. The last 2 pushbuttons represent yes, meaning to continue playing the game, and no, meaning that the player decides to walk away from the table (finish playing the game).

Circuit Schematic

uLCD color display board

MBEDuLCD HeaderuLCD Cable
5V = VU5V5V
GndGndGnd
TX = P28RXTX
RX = P27TXRX
P30ResetReset

Pushbuttons

First pin of the pushbuttons are connected to Digital In

MBEDPushbutton
P12Bet: $0
P15Bet: $25
P16Bet: $100
P17All In
P19Hit
P20Stand
P21Yes
P23No

Second pin of the pushbuttons are connected to ground

Internal pullup implemented in the code

Set Up

/media/uploads/gevell1/img_2423.jpg /media/uploads/gevell1/img_2421.jpg /media/uploads/gevell1/img_2422.jpg

Code

Import programBlackJack

Made by George and Pahul

Video Demo


1 comment on Blackjack:

15 Nov 2016

Do you have a SD Card inserted on top of the LCD?

Please log in to post comments.