u/ArtusIndus

I made Tetris on an Arduino Mega with 2x MAX7219 LED matrices
▲ 14 r/arduino

I made Tetris on an Arduino Mega with 2x MAX7219 LED matrices

I built a small Tetris clone for the Arduino Mega using two MAX7219 8x8 LED matrix modules combined into a 16x8 display.

The main goal was making the game run smoothly without display flickering or blocking delays.

Features:
- flicker-free delta rendering
- non-blocking game loop using millis()
- random tetromino generation
- piece rotation
- row clearing
- collision detection
- smooth button controls

Instead of clearing and redrawing the whole display every frame, the code only updates LEDs that actually changed. This reduced flickering a lot and made the animation much smoother.

The game also avoids delay() completely (except during startup random seeding), so inputs stay responsive while the pieces are falling.

Hardware used:
- Arduino Mega 2560
- 2x MAX7219 LED matrix modules
- 3 push buttons

The buttons use INPUT_PULLUP and connect directly to GND.

I might add:
- score counter
- sound effects
- level/speed system

GitHub

youtube.com
u/ArtusIndus — 4 days ago

https://reddit.com/link/1t1xquh/video/u2vg4prnpryg1/player

Hey everyone,

I built a simple lap timing system for my Carrera racing track using an Arduino and a 16x2 LCD display.

It reads data directly from the Carrera Control Unit via serial communication and calculates lap times for two cars in real time. The fastest lap is tracked automatically, and a small crown icon on the display shows which car currently holds the best time.

Features

  • Real-time lap timing for 2 cars
  • Fastest lap tracking
  • LCD output (16x2)
  • Crown indicator for best lap
  • Direct communication with Carrera Control Unit

How it works

The Arduino continuously requests data from the Control Unit and reads incoming messages until a delimiter ($) is received.
When a car crosses the sensor, the lap time is calculated using millis() and displayed instantly.

The first lap is ignored to avoid invalid timing.

Limitations

  • Uses String (can cause memory issues over long runs)
  • Serial reading is blocking (readStringUntil)
  • Currently limited to 2 cars
  • No lap counter or race logic yet

Possible improvements

  • Switch to char[] instead of String
  • Non-blocking serial parsing
  • Support for more cars
  • Add lap counters and race modes
  • Store best lap in EEPROM

Hardware

  • Arduino (Uno / Nano)
  • 16x2 LCD (HD44780 compatible)
  • Carrera Control Unit

Code

Full project on GitHub.

reddit.com
u/ArtusIndus — 20 days ago