Hello! Newb here trying to get an 8 digit 7 segment MAX7219 display working with Arduino Nano ESP32. I've seen and read other posts here and elsewhere on the internet and I'm not having luck.
I bought these displays from amazon: Amazon.com: AOICRIE 6 PCS 8-Digit 7 Segment MAX7219 Digital Segment Module, Seven Section 8 Bit LED Display Tube for MCU/51/AVR/STM32 for Raspberry Pi ESP8266 Nodemcu (Pack of 6) : Industrial & Scientific
After messing with them, I could get all the segments to light up when plugged in, but couldn't get any actual readout. I'm using the LedControl library, and demo code which I posted below. I've tried different pins, no luck. After reading the reviews for these displays, I figured maybe they were just low quality. May people complaining of issues, not working, stopped working. The MAX7219 chip on the display is blank and reviews are calling it questionable.
So I bought these displays which have better reviews and actually have the part number printed on the chips: Amazon.com: HiLetgo 2pcs MAX7219 8-Digital Segment Digital LED Display Tube for Arduino 51/AVR/STM32 : Industrial & Scientific
My result were basically the same. The entire display will light up if rebooted, but I can't get any sort of readout.
Other commenters say to check the connections. I've tried using a breadboard and M-F cables. I've tried F-F cables to connect the nano to the display. I've used short cables, longer cables. Nothing seems to make a difference. The nano is new and I've had success using it for other sensors and LEDs so far. But I'm struggling to get anything useful to display on them. So far I have 8 displays, and none are working as expected.
I'm using the pin out in the demo code which is included with the LedControl library, it's unmodified.
pin 12 is connected to the DataIn <--> DIN on the display
pin 11 is connected to the CLK <--> CLK on the display
pin 10 is connected to LOAD <--> CS on the display
I've tried 5v and 3.3v power from the nano. I tried adding a 500ohm resistor to the datapin shown here:
I'm not sure what else to try at this point. Any tips would be appreciated!
//We always have to include the library
#include "LedControl.h"
/*
Now we need a LedControl to work with.
***** These pin numbers will probably not work with your hardware *****
pin 12 is connected to the DataIn
pin 11 is connected to the CLK
pin 10 is connected to LOAD
We have only a single MAX72XX.
*/
LedControl lc=LedControl(12,11,10,1);
/* we always wait a bit between updates of the display */
unsigned long delaytime=250;
void setup() {
/*
The MAX72XX is in power-saving mode on startup,
we have to do a wakeup call
*/
lc.shutdown(0,false);
/* Set the brightness to a medium values */
lc.setIntensity(0,8);
/* and clear the display */
lc.clearDisplay(0);
}
/*
This method will display the characters for the
word "Arduino" one after the other on digit 0.
*/
void writeArduinoOn7Segment() {
lc.setChar(0,0,'a',false);
delay(delaytime);
lc.setRow(0,0,0x05);
delay(delaytime);
lc.setChar(0,0,'d',false);
delay(delaytime);
lc.setRow(0,0,0x1c);
delay(delaytime);
lc.setRow(0,0,B00010000);
delay(delaytime);
lc.setRow(0,0,0x15);
delay(delaytime);
lc.setRow(0,0,0x1D);
delay(delaytime);
lc.clearDisplay(0);
delay(delaytime);
}
/*
This method will scroll all the hexa-decimal
numbers and letters on the display. You will need at least
four 7-Segment digits. otherwise it won't really look that good.
*/
void scrollDigits() {
for(int i=0;i<13;i++) {
lc.setDigit(0,3,i,false);
lc.setDigit(0,2,i+1,false);
lc.setDigit(0,1,i+2,false);
lc.setDigit(0,0,i+3,false);
delay(delaytime);
}
lc.clearDisplay(0);
delay(delaytime);
}
void loop() {
writeArduinoOn7Segment();
scrollDigits();
}