กลับไปหน้ารวมไฟล์
lx-arduino-tetris-708606-en.md

LX' Arduino Tetris

A goal I set for myself for easter 2018: get a Tetris game running on a 32x32 LED matrix panel. This one uses Arduino/Genuino Uno as controller, which is rather limited in memory as I experienced. Large parts of the project consisted of finding ways around those limitations. Maybe I'll do a Arduino Mega adaptation for more memory in the near future.

The panel's wiring is just like suggested in Adafruit's documentation. The rest is just a resistor ladder for the four control buttons.

A demo of the game in action:

Full source code of the latest version can be found on GitHub.

EXPANDED TECHNICAL DETAILS

Classic Game Logic Implementation

LX' Tetris is a software-heavy project that recreates the iconic puzzle game on an 8x8 or 16x32 LED matrix.

  • Array-Based Collision: The "Well" (the game board) is stored as a 2D array. The firmware checks for bitwise overlap between the "falling piece" and the "settled pieces" every clock cycle.
  • Rotation Matrix: Uses pre-defined coordinate rotates for the 7 Tetriminos (I, J, L, O, S, T, Z), ensuring they spin correctly within the grid.

Hardware Feedback

  • Audio & Visuals: Includes a buzzer for "Line Clear" sound effects and uses color-switching logic if an RGB matrix is used, providing a truly "Game Boy" like experience in a DIY form factor.

ข้อมูล Frontmatter ดั้งเดิม

title: "LX' Arduino Tetris"
description: "A Tetris game for Arduino Uno and a 32x32 LED matrix panel."
author: "RomanSixty"
category: "Gadgets, Games & Toys"
tags:
  - "games"
views: 33704
likes: 49
price: 2450
difficulty: "Intermediate"
components:
  - "1x Arduino UNO"
  - "1x Breadboard (generic)"
  - "1x 32x32 RGB LED Matrix Panel"
  - "4x Pushbutton switch 12mm"
  - "1x Resistor 4.75k ohm"
  - "2x Resistor 10k ohm"
  - "1x Resistor 221 ohm"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles:
  - "https://github.com/RomanSixty/arduino-tetris"
  - "https://github.com/RomanSixty/arduino-tetris"
documentationLinks: []
passwordHash: "8aa3b9c9d4e80e00e7dc8ff8d210e9ddde86cca7ab2fe3a6fb62478a902450d7"
encryptedPayload: "U2FsdGVkX1+1OTnkdin9SR6qG4HQNRMYecnYTCd8XtCxtotDDxGPcKZ+7HWQzifws148IFxgGb7Ka3+5k9ZKD5ME+Nv13rPcdP+sWIHa1o0="
seoDescription: "Build a Tetris game using Arduino Uno and a 32x32 LED matrix panel. A fun DIY project for Arduino makers."
videoLinks:
  - "https://www.youtube.com/embed/rai_6IEXC00"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/lx-arduino-tetris-708606_cover.png"
lang: "en"