153B Final Project: BlackJack

Juan Mendoza-Martinez

Armaan Shah

Overview

Our project will replicate the functionality of a popular card game that is played between dealer and players at the table. For this project, there will be one player that is playing against the dealer in hopes of obtaining card values that are greater than the dealer’s but less than or equal to 21. This game will consist of a 16x2 LCD display, a 4x4 keypad connected, multi-colored LED lights connected to the GPIO pins. The keypad will serve the functionality of shuffling cards, obtaining a new card, raising the bets, or starting a new game and the LED lights will flash green if the player wins with 21 or red if the dealer wins any game. The display will show the player’s game balance as well as the suits and numbers of each card being dealt to each player (dealer and user).

Weekly Updates

-The game logic is being planned out in order to make the user-end easier to interact with for novice players. The parts have been ordered and are currently on the way. Interfacing the parts is the next step in progressing with the project.

-The screen display has been switched to LED instead of using LCD display. The game logic functionality has been tested using command line arguments; next steps involve interfacing the keypad and the display in order to show the actual game and it's contents.

-Working on implementing the library for displaying text on the LED display.

-Working with 4x4 key compatibility and interfacing.

-The implementation for the LED display was unsuccessful. An alternative solution was implemented with using the termite terminal as the main display for the game and the STM32 LCD for keeping the balance of the game, with ongoing updates. A new component (ultrasonic sensor) will be used to sense when there is a player at the table and starts the game.

Report

For the final result, we were able to recuperate the display of the BlackJack game onto the computer monitor display through the Termite terminal. This communication was enabled through bluetooth with the UART protocol. Due to extended complications with attempted to set up the LED SPI display library and developing the game logic, the keypad and the external SPI display were taken out of the original plan in order to improve the functionality of the game logic and sensor. Alternative protocols deemed to be more expensive, both in shipping time and cost ( since we weren't able to beat the AI dealer in our game enough times to make our money back). So, we reviewed previous course lab material to help us overcome unforeseen difficulties and circumstances. Upon completion, we were satisfied with the outcome despite the unanticipated hurdles and pieced together a Bluetooth BlackJack Game that requires input from a standard PC keyboard. From here on down, we shall let the video finish the talking for us:

Video Demo: