(2024 | Arduino, C++ (FastLED), WS2812B 16×16 matrices ×2, joystick, push‑buttons, buzzer, 5V/20A PSU, Fusion 360 CAD, laser cutting)
Overview
Physical Battleship game cabinet: each player gets a 16×16 RGB matrix (12×12 playable grid + animated border). A joystick and buttons control ship placement and bombing. The cabinet is laser‑cut from the CAD model; color language on the borders conveys game state (hit/miss/place/win/lose).
Development Process
Planning & Design
- Defined board layout: 12×12 playable cells per matrix; outer rows used as a feedback border (red=hit/error, green=miss, blue=placement phase, flashing patterns for win/lose).
- Modeled the cabinet in Fusion 360 with LCD/joystick/buttons/matrices, adjusted view angle for ergonomics, and produced a cardboard mock to validate fit before laser cutting.
- Power budgeted a 5V/20A supply; decided to blank the inactive matrix during opponent turns to reduce peak current.
Implementation
- Firmware in C++ using FastLED; grid rendering primitives (ships, cursor, hits, sunk) and animations. Example functions include ship drawing on active/inactive boards.
- Input stack for joystick + two buttons with debouncing; game state machine for phases (place → play → end).
- Computer opponent logic places ships validly and selects shots logically; score keeping and end‑game detection.
- Audio feedback via buzzer; border effects synchronized to events.
Deployment & Optimization
- Laser‑cut acrylic/wood panels from the CAD; assembled wiring harnesses and mounted components per the mock.
- Tuned brightness and frame timing to avoid flicker and stay within the PSU envelope; disabled the idle matrix to cap current draw.
- Reduced redraw cost by partial updates of changed cells; organized memory to fit microcontroller limits.
Key Highlights
- End‑to‑end hardware + firmware delivery: CAD → fabrication → assembly → embedded code.
- Real‑time LED rendering on dual 16×16 matrices with color‑coded border telemetry.
- Pragmatic power management (matrix blanking) and responsive inputs with a clear UI language.