Mechatronics Casino Project
Background
For our mechatronics project my team decided to make a casino station. We wanted to develop roulette, blackjack, and horse racing. I handled all code for this project, and utilized Arduino for the development. There were over 2000 lines of code for this project, housed within 3 Arduinos that communicated with eachother
Roulette
Due to the large amount of LEDs, shift registers were used for control.
The Arduino would receive a bet from the main console using an IR remote. The IR remote allowed for betting on all of the expected options for roulette. The main console Arduino would signal via the TX and RX pins to the roulette Arduino to begin the rotation. Seeded values determined the starting number, speed value, and speed decay values, offering a completely random experience each time. Arrays were used to house the win conditions for each number, and these arrays would be compared against the winning number to determine which bets paid out.
The video below shows our “arcade mode”, where the user tries to stop on a certain number. Videos of the roulette function do not exist for some reason.
Blackjack
I coded a full blackjack game on an LCD, complete with insurance, double downs, splitting, and all functionality that would be expected out of blackjack. “Shuffling” the deck and displaying the cards was the most complicated part. After many iterations, the result was a fully working, localized blackjack game that only needs an Arduino, an LCD screen, and a joystick for input. Videos of the blackjack game do not exist, though I am looking to rebuild it on my own time as the code still exists. Below are our flowcharts that show visually how complex the blackjack code was
Horse Racing
We had a “horse racing” track that was controlled by 4 servos that moved a plastic horse along the track. Each horse was calculated to have specific odds and payouts, with certain horses choosing their speeds for a higher option array than others. These speeds were changed every few seconds to offer random motion within the horses. Below is an image of the horsetrack prior to installing the horses on the chains, though unfortunately no videos of photos the final product seem to exist
Result
This project involved some of the most complex coding I have done. I wish that more was documented, as the end result was an impressive display of 3 Arduinos communicating, all controlled by a single joystick and LCD readout. I do think this is a project I will complete again, and I look to make the code open source soon.