Our inspiration for this project was the prompt. Even though Poker is conventionally a game that requires multiple inputs, we wanted to see if we could emulate Poker with only one. We created a poker game where the human player competes against two integrated bots. The player utilizes a rotary encoder in order to raise their bet and submit actions. To fold, the user simply does nothing for around 7 seconds. The arduino operates using serial communication with the python both ways. To begin we wired a 4 digit 7 segment display to show the player's current money balance. A premier challenge here was allocating digital ports on the arduino board with the encoder, display. and two displays. To combat this we used the analog pins as digital ports for two of the four digit pins on the display. Throughout the coding process, a main problem was within making sure the python backend has access to the communications port continuously without interrupting other processes on the Arduino. Furthermore, in the frontend, the cards were dealt to the bots face up on initialization of the web ui. To solve this, we attached separate states to the bots' cards and the player's such that the bots received cards defaulted face down and the player had cards face up. We developed the bots throughout the course of the competition to take into account multiple factors such as player actions, two card combinations, and relative turn in the table. We are most proud of successfully updating the display and rotary encoder input at the same time making use of hardware interrupts such that the display is not noticeably turned off. We learned that using libraries is very useful. For example, we used a library to display numbers on the 7 segment display in one line commands. Also, in the backend we used the treys python library, which assigns values to hands in order to establish the best hand in context of the river, to establish wins in poker. Without this the win logic would have taken much longer given the countless combinations in Poker such as pairs, full houses, and straights. In the future, we aim to refine the physical components such that the wiring is less obstructing and the system as a whole is refined into one presentable piece. Finally, we would like to implement multiple players over local and online connections.

Built With

Share this project:

Updates