squix78 / MAX7219LedMatrix

Library for the ESP8266 on Arduino IDE displaying text on multiple 8x8 led matrices
MIT License
159 stars 71 forks source link

MAX7219LedMatrix

Library for the ESP8266 on Arduino IDE displaying text on one or multiple MAX7219 8x8 led matrices.

This library displays text and sets specific pixels on one or multiple 8x8 led matrices with a MAX7219 driver chip controlled through the SPI interface. These modules are relatively cheep and can be daisy chained which makes it easy to get a led text bar up and running You can find modules e.g. with Banggood (<-affiliate link).

For details about the MAX7219 theory, wiring, schematic, etc. there's a great post by Nick Gammon: http://www.gammon.com.au/forum/?id=11516

Currently this library supports the following operations:

You're welcome to read in my blog how this library came about.

Example

#include <SPI.h>
#include "LedMatrix.h"

#define NUMBER_OF_DEVICES 1
#define CS_PIN 2
LedMatrix ledMatrix = LedMatrix(NUMBER_OF_DEVICES, CS_PIN);

void setup() {
  Serial.begin(115200); // For debugging output
  ledMatrix.init();
  ledMatrix.setIntensity(4); // range is 0-15
  ledMatrix.setText("MAX7219 Demo");
}

void loop() {
  ledMatrix.clear();
  ledMatrix.scrollTextLeft();
  ledMatrix.drawText();
  ledMatrix.commit(); // commit transfers the byte buffer to the displays
  delay(200);
}

Installing library in Arduino IDE

Connecting the module(s) to the ESP8266

LED Matrix ESP8266
VCC +3.3V
GND GND
DIN GPIO13 (HSPID)
CS Choose free GPIO, e.g. GPIO2
CLK GPIO14 (HSPICLK)