Can't get led matrix display to work on my arduino nano

Hi, i can't get a simple 8x8 max 7219 matrix to work.
I am only using a single element and im sure i wired it correctly.

This is my code:

#include <LedControl.h>

#define DIN 2
#define CS 3
#define CLK 4

#define ELEMENTS 1

#define INTENSITY 5

LedControl lc = LedControl(DIN, CS, CLK, ELEMENTS);

void setup() {
  for(int i = 0; i < ELEMENTS; i++) {
    lc.shutdown(i, false);
    lc.setIntensity(i, INTENSITY);
    lc.clearDisplay(i);
  }
}

byte a[8] = {B01111110, B1000001, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000 };

void loop() {
  for (int r = 0; r < 8; r++) {
    lc.setRow(0, r, a[r]);
  }
}

Do you think i did something wrong?
Thanks in advance.

I think it is a hardware issue, from what I cannot see on your schematic is you used common anode configuration and the part needs common cathode.

What do you mean? i am using a pre made module with a max 7219 driver.

What are you running that with ?

md_parola might make things easier.
Many examples provided.
GitHub - MajicDesigns/MD_Parola: Library for modular scrolling LED matrix text displays

Change to:
LedControl lc = LedControl(DIN, CLK, CS, ELEMENTS);
and test.

Thanks ruilviana! now it works, sorry for the stupid error

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.