# MAX7219/22 Library for 8x8 LED Matrix or Digit Displays

**URL:** <https://community.particle.io/t/max7219-22-library-for-8x8-led-matrix-or-digit-displays/8283>\
**Category:** Libraries\
**Created:** [November 20, 2014, 2:36am UTC](https://community.particle.io/t/max7219-22-library-for-8x8-led-matrix-or-digit-displays/8283 "2014-11-20T02:36:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cloris](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/cloris/32/2089_2.png) [@cloris](https://community.particle.io/u/cloris)\
**Post date:** [November 20, 2014, 2:36am UTC](https://community.particle.io/t/max7219-22-library-for-8x8-led-matrix-or-digit-displays/8283/1 "2014-11-20T02:36:37Z")

</div>

I just finished porting Eberhard Fahle’s LedControl library for controlling the MAX7219/MAX7221 with an 8x8 LED Matrix or 7-Segment displays. The port was very minor. The wiring was the ‘fun’ part. Spend the extra bucks and buy one of the backpacks!

It is registered as a library in the IDE and can also be found here: [https://github.com/chrisloris/LedControl-MAX7219-MAX7221](https://github.com/chrisloris/LedControl-MAX7219-MAX7221).

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [November 20, 2014, 3:06am UTC](https://community.particle.io/t/max7219-22-library-for-8x8-led-matrix-or-digit-displays/8283/2 "2014-11-20T03:06:34Z")

</div>

Cool! But the MAX7219 are kinda pricey 😛

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [November 20, 2014, 3:47am UTC](https://community.particle.io/t/max7219-22-library-for-8x8-led-matrix-or-digit-displays/8283/3 "2014-11-20T03:47:59Z")

</div>

NIce work!

There are also ports of the Adafruit libraries for this part. I have been using one of those for some time on my 7-segment LED clock “Time and Temp” project.

> **[Time and Temp Project](https://community.particle.io/t/time-and-temp-project/3046)**
>
> Here is a simple little project that everybody can make and modify to meet their needs. First you need a :spark: core; then you need an 1.2 inch LED display with i2c backpack from Adafruit. And you need a one-wire temperature sensor. And three 4.7K...

---

<div class="post-metadata">

**Author:** ![cloris](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/cloris/32/2089_2.png) [@cloris](https://community.particle.io/u/cloris)\
**Post date:** [November 20, 2014, 5:18pm UTC](https://community.particle.io/t/max7219-22-library-for-8x8-led-matrix-or-digit-displays/8283/4 "2014-11-20T17:18:54Z")

</div>

It is and it isn’t… Adafruit charges $10, Sparkfun charges $6 for a chip but $10 for a whole kit with the 8x8 LED and chip. Then all kinds of crazy prices on ebay.

---

<div class="post-metadata">

**Author:** ![cloris](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/cloris/32/2089_2.png) [@cloris](https://community.particle.io/u/cloris)\
**Post date:** [November 20, 2014, 5:21pm UTC](https://community.particle.io/t/max7219-22-library-for-8x8-led-matrix-or-digit-displays/8283/5 "2014-11-20T17:21:08Z")

</div>

I saw that. Was wishing I went for one of the backpacks and the i2c version as well. Still… fun was had. Getting ready to do a little POC where I use my .Net library to push messages to the display from an Azure website. Stay tuned!

---

<div class="post-metadata">

**Author:** ![good\_ham](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/good_ham/32/4127_2.png) [@good\_ham](https://community.particle.io/u/good_ham)\
**Post date:** [January 6, 2015, 5:26am UTC](https://community.particle.io/t/max7219-22-library-for-8x8-led-matrix-or-digit-displays/8283/6 "2015-01-06T05:26:19Z")

</div>

Looks good. How did you handle the serial line levels? I thought the MAX7219 required 5v logic levels, but the Spark Core only output at 3.3? I can’t tell for sure in the video, but it doesn’t look like there are any transistors in the circuit.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [January 6, 2015, 9:30am UTC](https://community.particle.io/t/max7219-22-library-for-8x8-led-matrix-or-digit-displays/8283/7 "2015-01-06T09:30:57Z")

</div>

There are several threads that deal with the 5V vs. 3V3 thing.

But for this case if communication only goes from Core to 5V device the Cores HIGH is most likely seen as HIGH on the other end too.  
(HIGH threshold 5V / 2 + 10%)  
If you want to receive data you may also get away with the 5V tolerant pins (D0, D1, D3, D4, D5, D6 and D7) and SoftSPI and/or Serial2 (on D0/D1).

But level shifting would always be the safer bet.

---

<div class="post-metadata">

**Author:** ![cloris](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/cloris/32/2089_2.png) [@cloris](https://community.particle.io/u/cloris)\
**Post date:** [January 9, 2015, 3:15pm UTC](https://community.particle.io/t/max7219-22-library-for-8x8-led-matrix-or-digit-displays/8283/8 "2015-01-09T15:15:47Z")

</div>

@good_ham That was my concern to, but it worked. In reviewing the specs, Input High Voltage is a min of 3.5V. The chip says max V is 6V. So it appears it should not work. Had a logic level shifter on standby but it wasn’t necessary. I may wire it in just to be sure it won’t just stop working one day.
