Skip to content

hemangjoshi37a/MatrixArcade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ MatrixArcade

One button. One 32ร—8 LED matrix. A pocketful of arcade games + a slick WiFi admin panel.

Platform Display Framework License Made by

MatrixArcade turns a cheap ESP8266 + MAX7219 4-in-1 (32ร—8) dot-matrix and a single button into a public-spot arcade and an info kiosk. Players get one-button games; you control everything from your phone over WiFi โ€” pick games, write notices, show a clock/weather, see live play stats, and more.

Made by hjLabs.in.

Highlights

  • ๐Ÿ•น๏ธ 3 one-button games โ€” Dino Run, Flappy, and the "11.11" reaction challenge.
  • ๐Ÿชง Info panels โ€” scrolling notices (multi-line + emoji), healthy-lifestyle sayings, internet clock, date, weather.
  • ๐Ÿ“ฑ WiFi admin panel โ€” sleek, mobile-friendly; no app needed (password-protected).
  • ๐Ÿ“Š Live gameplay analytics โ€” interactive charts (plays-by-hour per game, wins per game).
  • ๐Ÿ’พ Everything persists โ€” settings, high scores and stats survive power-off (saved to flash).
  • ๐Ÿ› ๏ธ Tunable โ€” brightness, scroll speed, screen-saver wait, per-panel durations, win effects, timezoneโ€ฆ
Game Control Goal
๐Ÿฆ– Dino Run Press = jump Jump over the cacti
๐Ÿค Flappy Tap = flap Fly through the gaps
โฑ๏ธ 11.11 Tap = stop Stop the clock at exactly 11.11s to win (the displayed value must read 11.11 โ€” nothing nearby counts). Number stays visible up to 15s; no press by 15s โ†’ back to start. Win = a celebration you customize in the panel! ๐ŸŽ†
  • Tap = play / jump / flap / stop.
  • Hold (~0.6 s) on the menu = switch to the next game.
  • High scores, 11.11 best time, win counts and total plays are saved to flash (survive power-off).

๐Ÿชง Info panels (not games)

Besides games, the display rotates through info panels โ€” for each one you set on/off, how many seconds it shows, and a โ–ถ preview (test it on the matrix instantly), all in one row of the admin panel: Notice (custom multi-line text, with emoji ๐Ÿ’š) ยท Sayings (healthy-lifestyle tips) ยท Clock (internet time) ยท Date ยท Weather (any city, with humidity/wind/etc). In All-in-one style (games on + panels on) it plays games normally and, after a configurable screen-saver wait, cycles the enabled panels until someone presses the button. Turn games off for a pure kiosk. When idle, it also shows a MADE BY HJLABS.IN promo every ~30 minutes.

โœจ Notice features

  • Multiple lines โ€” add/remove lines (each scrolls in turn).
  • Fonts โ€” Normal / Bold / Italic / Wide.
  • Emoji โ€” a curated set renders as 8ร—8 icons: โค โญ โ˜€ โœ… ๐Ÿ”ฅ ๐Ÿ’ง ๐ŸŽ ๐ŸŽต ๐Ÿ‘ ๐Ÿ™‚ (others are skipped).
  • Smooth scrolling โ€” text now renders at 60fps with time-based motion, so it's smooth even at low speeds.

โš ๏ธ This module is SPI, not IยฒC

The MAX7219 has VCC / GND / DIN / CS / CLK = SPI. (DIN/CLK below are the ESP8266 hardware-SPI pins.)

๐Ÿ”Œ Wiring

MAX7219 module NodeMCU pin ESP8266 GPIO
VCC VIN (5 V) โ€”
GND GND โ€”
DIN D7 GPIO13 (MOSI)
CLK D5 GPIO14 (SCK)
CS D6 GPIO12

๐Ÿ”˜ Button on D1

Button between D1 (GPIO5) and GND โ€” that's it.

  D1 (GPIO5) โ”€โ”€/ button โ”€โ”€ GND
  • D1/GPIO5 is a safe, normal pin (no boot caveat like D8 had).
  • Uses the internal pull-up, so no external resistor is needed. The firmware is set for this (BTN_PIN D1, BTN_ACTIVE_HIGH 0).
  • Pressed = LOW. Idle = HIGH.

Power: one panel from VIN (5 V) at low brightness is fine. For more panels / high brightness, use a separate 5 V supply and join grounds.


๐Ÿ“ถ WiFi Admin Panel

  1. Power the device. It creates an open WiFi access point named MatrixArcade.
  2. Connect your phone/laptop to it โ€” a captive portal login pops up automatically (or browse to http://192.168.4.1).
  3. Enter the password admin123.
  4. From the panel you can:
    • Enable games: on = button plays games; off = kiosk (panels only).
    • Panels to rotate: tick which of Notice / Clock / Date / Weather appear, and set how many seconds each one shows.
    • Notice lines: add multiple lines with + Add notice line (each added line has a โœ• delete button; they're shown one after another). Pick the font (Normal / Bold / Italic / Wide).
    • Text scroll speed: slider (applies to all scrolling text).
    • Weather city + Time zone โ€” clock auto-sets from the internet (NTP); weather shows condition, temp, feels-like, humidity, wind, rain, pressure.
    • 11.11 win screen: effect + message, with a โ–ถ Test button to preview it on the display instantly.
    • Live win alerts: when someone wins, the open admin page shows a banner + plays a sound + vibrates. Use the Test alert button to try it. (True OS pop-up notifications additionally require HTTPS, which the device doesn't serve โ€” so banner+sound is the reliable path over the device's plain-http page.)
    • Mode: Menu (players cycle games with Hold) or ๐Ÿ”’ Locked (only the chosen game plays โ€” pick it in "Locked game").
    • Locked game: which single game runs in Locked mode.
    • Enabled games: which games appear in the menu.
    • Brightness: 0โ€“15, applied live.
    • 11.11 winning screen: choose the effect (Fireworks / Flashing WIN / Expanding rings / Sparkle rain / Text only) and type a custom win message.
    • Screen-saver wait: how long the display sits on the game start-screen before the info panels take over (saved to flash).
    • WiFi: join your home network (see below) so you can reach the panel without connecting to the device's AP.
    • Winning stats: total plays, 11.11 wins, best 11.11 time, and high scores.
    • Reset high scores or counters.

The AP is open so anyone can reach the login page; the admin123 password gates the controls. This is hobby-grade security (password is hardcoded in the sketch) โ€” fine for a fun installation, not for anything sensitive. Change it via ADMIN_PASS / SSID via AP_SSID in the .ino.


๐ŸŒ Connecting it to your home WiFi (optional)

By default the device runs its own access point. You can also join it to your home WiFi so you can open the admin panel from your normal network โ€” without switching to the device's hotspot.

  1. Connect to the MatrixArcade AP โ†’ log in (admin123) โ†’ Configure WiFi.
  2. Pick your network from the scanned list, enter the password, Save & connect.
  3. The device reboots, joins your WiFi, and scrolls its IP address on the matrix at startup.
  4. From any device on your home network, open that IP or simply http://matrixarcade.local (mDNS โ€” no need to remember the IP).
  • Connecting is non-blocking โ€” the games run immediately while it joins in the background, and it scrolls the IP once it connects.
  • It tries the home WiFi for ~1 minute; if it can't connect (e.g. router slow/off), it switches to AP-only mode so the setup portal is always reachable. A dropped connection gets a fresh 1-minute retry window. Rebooting or saving WiFi again re-tries.
  • "Forget WiFi" in the WiFi page returns it to AP-only mode.

Why matrixarcade.local instead of an HTML page that "auto-scans" the network? Browsers can't port-scan a LAN for security reasons, so that approach isn't reliable. mDNS is the proper, robust way to find the device by name. On most phones/PCs *.local works out of the box (Android may need the IP shown at boot).

๐Ÿ–ฅ๏ธ Serial preview commands (for testing screens)

Open the Arduino Serial Monitor at 115200 baud, type a command, press Enter โ€” the matrix jumps straight to that screen so you can see how it looks:

Command Shows
dino / flappy that game's game-over screen
win the 11.11 WIN celebration (using the current effect + message)
miss the 11.11 "missed" result screen
best the NEW BEST screen
rotate the info-panel rotation preview (notice/clock/date/weather)
weather fetch the weather right now
play dino/flappy/1111 start that game live
help list all commands

๐Ÿงฐ One-time setup (Arduino IDE)

  1. ESP8266 board support: Preferences โ–ธ Additional Boards Manager URLs โ†’ http://arduino.esp8266.com/stable/package_esp8266com_index.json, then Boards Manager โ†’ install esp8266.
  2. Library: Manage Librariesโ€ฆ โ†’ install MD_MAX72XX (majicDesigns).
  3. Board: NodeMCU 1.0 (ESP-12E Module) (or LOLIN(WeMos) D1 mini); pick the Port.

โ–ถ๏ธ Upload

Open MatrixArcade/MatrixArcade.ino โ†’ Upload. The display should scroll >DINO RUN BEST 0 โ€ฆ. Tap to play.

Or with arduino-cli (already installed on this machine)

~/.local/bin/arduino-cli compile --fqbn esp8266:esp8266:nodemcuv2 MatrixArcade
~/.local/bin/arduino-cli upload  -p /dev/ttyUSB0 --fqbn esp8266:esp8266:nodemcuv2 MatrixArcade

(Find the port with arduino-cli board list.) โœ… Verified compiling: RAM 37%, flash 27%.


๐Ÿ› ๏ธ If the picture looks wrong

Edit the #defines at the top of MatrixArcade.ino:

Symptom Fix
Text garbled / split across panels change HARDWARE_TYPE โ†’ GENERIC_HW, then ICSTATION_HW, then PAROLA_HW
Mirrored leftโ†”right #define FLIP_X 1
Upside down #define FLIP_Y 1
Only letters upside-down #define FONT_FLIP_Y 1
Button does nothing check button is between D1 and GND

๐ŸŽš๏ธ Tuning

  • 11.11 difficulty: REACT_TOL (win window, default ยฑ0.20 s) and REACT_TIMEOUT (auto-reset time, default 15 s).
  • Game speed/feel: the constants inside each game's namespace.
  • Frame rate: FRAME_MS (33 โ‰ˆ 30 fps).

โž• Want Snake / Tetris / Pong?

Those need direction control โ€” add 2โ€“3 buttons (pin โ†’ GND) and I'll wire in a D-pad and those games.

๐Ÿ“ Layout

esp_matrix_games/
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ platformio.ini          # optional (system PlatformIO is broken here; use arduino-cli)
โ””โ”€โ”€ MatrixArcade/
    โ””โ”€โ”€ MatrixArcade.ino     # open this

About

๐ŸŽฎ One-button arcade games + info kiosk for an ESP8266 & MAX7219 32ร—8 LED matrix, with a mobile WiFi admin panel, live stats & info panels. By hjLabs.in

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages