Arduino Playground is read-only starting December 31st, 2018. For more info please look at this Forum Post

Controlling a Led matrix or 7-segment displays with the MAX7219 or the MAX7221

There are different solutions for driving this popular piece of hardware from the Arduino. If you are not familiar with the MAX7219 or MAX7221 you should start by reading the hardware related documents

The software for driving these chips is covered on several pages:

  • Marc MERLIN has written a LED-Matrix a bi color/RGB PWM driver for bi/tricolor matrices using only direct IO and/or shift registers. Code here: https://github.com/marcmerlin/LED-Matrix/ and video demo: https://www.youtube.com/watch?v=tKCOY1tTtM4 . It offers support for the Adafruit::GFX library drawing and text functions.
  • The 8x8 Matrix controlled by a max7219 article provides code examples and a schematics for driving a 8x8 Led matrix. Supports multiple cascaded MAX7219.
  • The Matrix-library This is the original documentation for the Matrix-library that was shipped with the Arduino software pre Arduino 1.0. The library supports only a single MAX7219 and only works with Arduino 022 and below. To connect multiple MAX7219s together you wire the clk and data to the same lines but the load data line goes to a different pin, also you must define a new matrix and give it a different name.
  • The LedControl-library Supports the MAX7219 and the MAX7221. It can drive multiple devices and has a specific command-set for 7-segment displays (besides the common Led matrix functions).
  • The MAX7219-Library is another available library that supports cascaded MAX7219's and some basic matrix functions(e.g shiftleft, shiftright, flip, rotate, raise, lower).
  • The Max72xxPanel library implements Adafruit's GFX library for multiple 8x8 LED displays driven by MAX7219 or MAX7221, in arbitrary rectangular layout. Support for basic graphic primitives and text. Features double buffering to prevent flicker.
  • The MD_MAX72XX supports multiple MAX72XX hardware, text functions. and is used by the popular MD_Parola for advanced text animations display.

More specific problems with the MAX7219 or MAX7221 have been discussed several times on the Arduino Hardware Forums.