I sure had a lot of fun writing this. I uncovered several surprises:
- There are many ways to seed the random number generator.
- There is some data type ambiguity with naked constants in the .write method.
- Integer currency didn’t work with Blackjack payouts (bet x 1.5) and odd value bets (unless you intend to cheat the player). It was actually fun to add the cents though.
- For some reason one of the LCD special characters (“10”) gets garbled from time to time. Still not sure why.
- I really need to work with objects more and less with procedural code.
- Multi-dimensional arrays are cool!
Read the comments at the beginning of the sketch. They’ll tell you everything you need to know. I believe the code is well commented. Let me know if you discover any new bugs. I’d love to have the opportunity to fix them. I welcome suggestions for alternative approaches to some of the programming logic. This really was a lot of fun for me and I hope you enjoy it. 8)
If you found this fun or interesting please make a small donation to my PayPal account at https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GTBD7T7BXPGQY. I have many more Arduino projects in mind and appreciate your support.
Moderator edit: reference to company selling counterfeit product removed
Arduino_Blackjack.ino (14.1 KB)