Project Overview
The "Quantum-Choice Mini Console" is a compact, portable gaming system that implements the classic Zero-Sum Game, Rock Paper Scissors. Designed as an entry-level study in Human Interface Design (HID) and Random Number Generation (RNG), the project utilizes an Arduino UNO and a high-contrast SSD1306 OLED to provide a visually engaging user experience. Whether playing in the 1v1 Local Multiplayer mode or against the algorithm-driven Computer AI, the system provides a seamless, bounce-free interaction loop that gamifies basic logical branching.
Technical Deep-Dive
- SSD1306 OLED Graphics Pipeline:
- I2C Bus Architecture: The display communicates via a 2-wire serial protocol (SDA/SCL), minimizing the pin usage on the Arduino. The firmware utilizes the
Adafruit_GFXlibrary to draw complex primitives and bitmap sprites. - Bitmap Rendering: To improve the "Triple-A" feel of the mini-game, custom 128x64 monochromatic bitmaps are stored in the Arduino’s Program Memory (PROGMEM). These sprites represent the hand gestures (Rock, Paper, Scissors) and are blitted to the display buffer only when called, preserving precious SRAM for game variable logic.
- I2C Bus Architecture: The display communicates via a 2-wire serial protocol (SDA/SCL), minimizing the pin usage on the Arduino. The firmware utilizes the
- Probability & RNG (Player vs. AI):
- Pseudo-Random Algorithms: In the Single Player mode, the computer’s choice is generated using the
random()function. To ensure the sequence isn't predictable upon every reboot, the code "seeds" the generator using the thermal noise from an unconnected analog pin (e.g.,randomSeed(analogRead(0))). - Decision Matrix Logic: The win/loss arbitration is handled via a Switch-Case Matrix or nested
if-elseblocks. With 9 possible outcomes (3 selections x 3 selections), the system evaluates the state in real-time and declares a "Win," "Loss," or "Draw" state.
- Pseudo-Random Algorithms: In the Single Player mode, the computer’s choice is generated using the
- Hardware Debouncing & Input State:
- Pull-down Resistor Array: To prevent false triggering from electrical noise, each tactile switch is tied to GND via a 1k-ohm resistor. This ensures that the digital input pins are never in a "Floating" state, maintaining a logical LOW until a button press pulls it to a logical HIGH.
- Non-Blocking Logic: The game loop monitors inputs without using
delay(), allowing for responsive animations and immediate game-restarts during "Draw" conditions.
Engineering & Operation
- Dual Mode Architecture: The game features a toggle between PvP (Player vs Player) and PvAI (Player vs AI). This is managed via a software flag; in PvAI mode, the secondary input pins are ignored, and the computer’s internal choice variable is populated by the RNG engine.
- UX Design (Visual Feedback): The project documentation emphasizes "Responsive Visuals." Upon selection, the OLED displays the player's choice alongside the opponent's choice, providing a 2-second "Dramatic Reveal" before updating the score counter.
- Simulation & Testing: The build was verified using the Wokwi Online Simulator, ensuring the logical timing between the I2C display updates and the button interrupts was stable before moving to physical hardware.
- Prototyping Strategy: Originally conceived as a touch-screen game, the project was "Value Engineered" down to tactile buttons. This reduced the BOM (Bill of Materials) cost significantly while increasing the tactile satisfaction and durability of the handheld console, making it an ideal classroom project.