Hello,
i have a max7219 board with 8x32 leds (4 8x8 leds).
I'm running the example program from MD_Parola (it does not matter which one - the problem appears with all of them). And the first two 8x8 panels work fine, but the last two light up at a 100% (some LEDs do not light at all), and not matter what i do I'm not able to display text on them.
(Info: The 8x8 panels are fine, i switched them back and forth and the problem existed. And i know that i need to change the direction of the text, but thats not my problem.
Try the following sketch and check that the 4-8x8 LED Matrix Display Unit shows:- 23.56 which (Fig-1) is being shown by my NANO now. Note that I have taken care of the comments of post #5@noiasca.
// Including the required Arduino libraries
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
#define CS_PIN 10
// Create a new instance of the MD_Parola class with hardware SPI connection
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
float number = -23.57;
char buffer[20]; // Make sure the buffer is large enough
void setup()
{
myDisplay.begin();
myDisplay.setIntensity(0);
myDisplay.setTextAlignment(PA_CENTER);
myDisplay.displayClear();
delay(2000);
//------------------
// Convert the float to ASCII with 2 decimal places of precision
floatToASCII(number, buffer, 2);
myDisplay.print(buffer);
}
void loop() {}
void floatToASCII(float num, char *buffer, int precision)
{
// Handle the case where the number is negative
if (num < 0)
{
*buffer++ = '-';
num = -num;
}
// Extract the integer and fractional parts
int intPart = (int)num;
float fracPart = num - (float)intPart;
// Convert the integer part to ASCII
int length = snprintf(buffer, 10, "%d", intPart);
buffer += length;
// Add the decimal point
*buffer++ = '.';
// Convert the fractional part to ASCII with the specified precision
for (int i = 0; i < precision; i++)
{
fracPart *= 10;
int digit = (int)fracPart;
*buffer++ = '0' + digit;
fracPart -= digit;
}
// Null-terminate the string
*buffer = '\0';
}
Thanks for the reply! As written in my question I already swapped the modules back and forth and swapped them, nothing has changed. The pannels on position 3/4 always were on.
Doesn't this imply that it is a Problem with the chip? I Mean i only swapped the LED-Pannel, the 4 chips stayed always at the same position - so i can eliminate that it is a Problem with the LED itself. (See next answer for photo of my LED).
Yes im using a pre-assembled board with already soldered chips and connections.
Yes I've tried it, but then the first two panels simply are black/show at most a line (depending on the speed) and the other two 8x8 panels are the same as before, i.e. on at 100%.
Well before you buy new modules and you want to do more debugging, then cut the traces between the 2nd and 3rd module and apply the power and signals to the 2rd module. See if the 2nd and 3rd modules work.