Proje Defteri

8x8 LED Matrix Generator for MAX7219

Draw on one 8x8 module or a chain up to 8x64, build a frame animation and copy a complete Arduino sketch for LedControl or MD_MAX72XX. Also exports uint64_t constants and raw byte arrays. Runs in your browser.

Click an LED to switch it, or drag to paint. The first LED you touch decides whether the drag draws or erases. Shifting wraps around the edges.

Text uses a 5x7 font, one character per module (A-Z, 0-9), starting at the module picked above.

Frame 1 of 1

Image rotated, mirrored or the modules in the wrong order on the real display? Fix it here instead of redrawing: these options change only the generated code. The defaults match FC-16 4-in-1 boards, where device 0 is the rightmost module. Generic single modules often need 90 or 270 degrees.

// Loading…

Paste 64-bit hex constants, one per image, separated by commas or new lines. A whole IMAGES[] array from the xantorohara editor works too. Each constant becomes a frame and replaces the current ones (Undo brings them back).

Drawing and animating a MAX7219 LED matrix

The red 8x8 LED modules sold for Arduino are almost all built around the MAX7219. This page turns a drawing on one module, or a chain of up to eight, into an animation and a sketch you can upload as is.

What is the MAX7219?

The MAX7219, originally from Maxim Integrated and now part of Analog Devices, is a serially interfaced LED display driver. Its datasheet describes it as a common-cathode driver for 7-segment displays of up to 8 digits, bar graphs, or 64 individual LEDs, and 64 LEDs is exactly one 8x8 matrix. The chip keeps the image in its own 8x8 static RAM and multiplexes the LEDs itself, so the board only writes when something changes. One external resistor sets the LED current and a 16-step intensity register sets brightness from code.

Data arrives as 16-bit packets on DIN, clocked by CLK and latched by LOAD, the pin most modules label CS. Everything clocked in comes back out of DOUT, which is how several chips share the same three wires: four modules in a row make the popular 8x32 display. One detail matters for every sketch: at power-up the MAX7219 starts blanked, in shutdown mode, with the intensity at its minimum. That is why the generated code calls shutdown(d, false) and sets the intensity before drawing anything.

Wiring for Arduino Uno and ESP32

Module pinArduino Uno / NanoESP32 (VSPI)
VCC5V5V (VIN)
GNDGNDGND
DIND11 (MOSI)GPIO 23 (MOSI)
CSD10GPIO 5
CLKD13 (SCK)GPIO 18 (SCK)

Always wire the input side of the module, the one marked DIN. To chain separate modules, connect DOUT of one to DIN of the next and share VCC, GND, CS and CLK. FC-16 4-in-1 boards already do this on the PCB. The LedControl sketch drives the bus in software, so any three free pins work. The MD_MAX72XX sketch uses hardware SPI, so DIN and CLK must sit on the MOSI and SCK pins shown above. If you are not sure where those are on your board, check the Arduino pinout or the ESP32 pinout.

How to use the editor

  1. Pick the matrix size. Each module adds 8 columns, so four modules give 8x32.
  2. Draw with the mouse or a finger, or start from a shape or a line of text.
  3. Use Duplicate to build the next frame from the current one, then change a few LEDs. Play previews the loop at the delay you set.
  4. Choose the output tab, set the board and pins, then copy the sketch or download it as an .ino file.
  5. Upload it. If the picture comes out rotated, mirrored or scrambled, change the output options and upload again; the drawing never needs to be redone.

Work is autosaved in this browser, and Copy share link packs the whole animation into the URL.

How the bytes map to LEDs

Each row of an 8x8 module is one byte. In the LedControl and MD_MAX72XX output the most significant bit is the leftmost LED, so 0b10000001 lights the two outer LEDs of a row and 0b00011000 the two in the middle. The heart shape is eight such rows:

0b01100110
0b11111111
0b11111111
0b11111111
0b01111110
0b00111100
0b00011000
0b00000000

LedControl sends row r to the chip's digit register r + 1 with lc.setRow(device, r, value). The uint64_t format packs all eight rows into a single 64-bit number: row 0 is the lowest byte, and inside each byte bit 0 is the left column. That is the layout of the widely used xantorohara LED Matrix Editor, so its constants can be pasted into the import box above. The same chip can also drive eight 7-segment digits instead of a matrix; for that, the 7-segment encoder gives you the segment bytes.

LedControl, MD_MAX72XX or MD_Parola?

Troubleshooting

Mirrored, rotated or scrambled image. Nothing is wrong with the bytes; the module is wired differently from what the code assumes. With LedControl, use Rotate each module, Mirror each module and Reverse module order. With MD_MAX72XX, change HARDWARE_TYPE to PAROLA_HW, GENERIC_HW or ICSTATION_HW first and leave the rotation at 0.

Nothing lights up. Check that the sketch wakes the chip with shutdown(d, false) and sets an intensity, that VCC is 5V, and that the wires go to the DIN side, not DOUT. Then check for swapped CS and CLK wires.

Only some modules work, or they all show the same thing. The device count in the sketch must match the number of modules in the chain. Set the matrix size here to the real length.

Flicker, resets or dim LEDs with many modules. A long chain at full brightness draws more current than a USB port or a board regulator is happy to give. Lower the intensity, and power the matrix from a separate 5V supply with its ground tied to the board's ground. The datasheet also recommends a 10 µF electrolytic and a 0.1 µF ceramic capacitor between V+ and GND close to each chip.

Working on a monochrome OLED instead? The GIF to OLED animation tool turns a GIF into frames for SSD1306 displays.

Frequently Asked Questions

How do I make an 8x8 LED matrix animation?

Draw the first image, press Duplicate to copy it into a new frame, change a few LEDs and repeat. Play shows the loop at the delay you set in milliseconds. When it looks right, pick LedControl or MD_MAX72XX, copy the sketch and upload it. The frames are stored in PROGMEM and the loop shows them one after another with that delay.

What is the difference between LedControl and MD_MAX72XX?

LedControl is a small library that drives the MAX7219 bus in software, so any three pins work, and it supports up to 8 chained devices. You write whole rows with setRow. MD_MAX72XX uses hardware SPI, knows the wiring of common module types through HARDWARE_TYPE, and is the base that MD_Parola builds on for scrolling text. For a few static frames both are fine; for a long chain or text effects MD_MAX72XX is the better start.

How do I connect 4 MAX7219 modules (8x32)?

A 4-in-1 FC-16 board is already chained on the PCB, so you only wire its input side: VCC to 5V, GND to GND, DIN to pin 11, CS to pin 10 and CLK to pin 13 on an Uno. With separate modules, connect DOUT of each module to DIN of the next and share VCC, GND, CS and CLK. Then set the size to 8x32 here so the sketch uses 4 devices.

Why is my LED matrix mirrored or upside down?

Module makers wire the LED matrix to the MAX7219 in different ways, so the same bytes can come out rotated, mirrored or with the modules in the wrong order. With LedControl use the Rotate, Mirror and Reverse module order options under the code; they change the output only, not your drawing. With MD_MAX72XX change HARDWARE_TYPE from FC16_HW to PAROLA_HW, GENERIC_HW or ICSTATION_HW.

Can I use it with ESP32?

Yes. Pick the ESP32 preset and the pins become DIN 23, CLK 18 and CS 5, the default VSPI pins. Power the module from 5V. The MAX7219 datasheet asks for at least 3.5 V as a logic high at a 5 V supply, above the 3.3 V an ESP32 outputs, so if you see random pixels add a 5 V level shifter on DIN, CLK and CS.

Is my drawing uploaded anywhere?

No. The editor, the code generator and the import all run in your browser and make no network requests. Your work is autosaved in this browser's local storage. The share link carries the drawing inside the URL itself, so nothing is stored on a server.