LED matrix display - MD_Parola, MD_MAX72xx and MD_MAXPanel

  1. Library is adapted to my hardware, setting 'USE_GENERIC_HW' to 1 and the rest to 0.

If this is not working try the other settings. If they also don't work use the HW_Mapper example program to work out what the configuration should be. They look like Generic modules but clearly they must be wired differently.

  1. I'm using pins 10 (CS), 11 (DIN) and 13 (CLK), that's to say, hardware setup, although I have software SPI setup set to 1 in the library. I have changed that to 0 though for checking. Nothing changed.

As soon as you get even 1 module working the comms pins are right and you should not change this any more. I would recommend using the hardware setting as this will be faster.

Do you think it is possible to achieve that with my current hardware by lowering light intensity, so that I don't have to use an external power supply?

That depends on a lot of things, like how many LEDs wold be on at the same time, the intensity you are runnning, etc. The main parameter you can change is the Rset resistor on the boards. Please see my blog article at MAX7219 and LED matrix power requirements – Arduino++ for some more information.

Hello Marco:

I must be doing something wrong because no matter which hardware configuration I set to 1 in the library, the behaviour of the led matrix is always the same (text displayed rotated and mirrored). I have also tried the HW_Mapper returning the same configuration as the 'USE_GENERIC_HW' one (010). After modification, I save the changes in the library, close it and restart the Arduino IDE. Do you have any clue what can be happening?

Thank you. Cheers.

Your problem is not something I have ever seen before, so I am guessing that something is not being set right in the libraries. Here's two suggestions:

  1. Make absolutely sure that all the USE_* settings that you are not using are set to 0. Any that are set after your intended setting will replace the intended setting. An approach may be to go back to a MD_MAX72xx library from the download package, now that you know a bit more about what you are meant to do.
    The settings I am concerned about are in the MD_MAX72xx.h file:
USE_PAROLA_HW
USE_GENERIC_HW
USE_ICSTATION_HW
USE_FC16_HW
USE_OTHER_HW

Also, there should have been no changes to the MD_MAX72xxlib.h file.

  1. In the first post you asked "do I need to add a transform() somewhere" and the answer is NO. Did you do this in the past and have forgotten about it?

Hello Marco:

I finally got the matrix working. I don't know what was the problem. I repeated everything from scratch and this time it worked. I probably was bringing some mistake... Thank you so much for your interest in helping me.

Now I have the matrix working with the SD card. But what I would like to do is to display a complete text line from the txt file based on a sensor. Using a microphone, IR sensor, whatever. If I code that in the loop() what I get is that everytime the condition is met, the text moves one column to the left. So the thing must be set on the library, modifying it, I guess. I've been trying it, with no success. How do you think I could do that?

Thank you Marco :slight_smile:

Good news.

Look at the example that uses the serial line to display messages. You need to use the same technique to make one message and display it and then substitute the new message when you have one. I would also suggest that you get familiar with how you need to use the library as it sounds like you are not animating the text fast enough.

If you want to make the message flexible, I would suggest that you use sprintf() and keep the formatting string in on the SD card. You can then use the string from the SD card to make the message using the data from the sensor. If you have not used sprintf() or printf() before, make sure you read how it is used before asking questions, as it is very flexible but also complicated for newbies.

Hi Marco, this is an awesome. I'm very new to Arduino and Parola and I think I'm learning quite fast but I seem to have run into a stupid problem. I have completed many searches without success and I'm hoping for a little bit of guidance from you if possible.

I have gone through all the examples and successfully got them working and have now started to build a very simple sketch to print a temperature. This is successful and I have used the following code snippet

 sprintf(temperature, "%d.%d C", (int)temp, (int)(temp*10)%10);
  P.displayText(temperature, CENTER, 0, 0, PRINT, NO_EFFECT);

To complete the display I would like to show the degree symbol in the appropiate place. I know it is character 247 in the md_max72xx library but I cannot workout how to call it into the sprintf function and then to the display.

Any help/guidance would really be appreciated

Standard C strings can include a specific ASCII code using the escape character ''. Here is an example from the Parola_Fonts sample code

"\x0b1\x0b0\x0c2\x0b2\x0c9"

More details here: Escape sequences - cppreference.com

Thanks Marco for the pointer.

I have shown the code that worked for me below.

 sprintf(temperature, "%d.%d\xF7""C", (int)temp, (int)(temp*10)%10);
  P.displayText(temperature, CENTER, 0, 0, PRINT, NO_EFFECT);

The secret I found was to convert the decimal value of the degree symbol into the hexadecimal value and use this after the escape character ''. I was able get to the format xx.xºC through the use of the end/start quotation marks in the centre.

I'll certainly know how to do this in the future!

Great coaching, thanks!

Peter

Hello Marco !

Great work in your parola library, thany a lot. U saved my day.
I thought about using a parola led matrix to display mirror-inverted text like on some german police cars.
Would be cool to be able to read text via a mirror. May i suggest to add such a function in the parola library ?

Greetings from Northern-Germany !

Actually, you can already do the reversed text using the library :slight_smile:

char *msg[] = 
{
  "Ambulance",
  "Emergency",
};

void setup(void)
{
  // initialise the LED display
  P.begin();
  P.setZoneEffect(0, true, FLIP_LR);
}

void loop(void)
{
  static uint8_t cycle = 0;

  if (P.displayAnimate())
  {
    // set up the string
    P.displayText(msg[cycle], CENTER, SCROLL_SPEED, PAUSE_TIME, PRINT, NO_EFFECT);
  
    // prepare for next pass
    cycle = (cycle + 1) % ARRAY_SIZE(msg);
  }
}

Hi Marco,
I have the DHT22 and the RTC module however are a bit clueless on how to connect them to the Arduino UNO to make a calendar clock from your Sketch Zone Time. What pinouts are there.

Many thanks kind regards Spence.

At the top of the sketch (as in most sketches) you will find the hardware definitions:

#if	USE_DHT11
#include <dht11.h>

#define	DHT11_PIN	2

dht11	DHT11;
#endif

The DS1307 is an I2C device, so you need to connect the I2C pins (from memory these are A4 and A5, but check).

and you enable the functionality using these defines

// Use the DHT11 temp and humidity sensor
#define	USE_DHT11	0

// Use the DS1307 clock module
#define	USE_DS1307	1

Hello. Is there a way for me to use the MD_MAX72xx lib to create a scrolling led matrix display from scratch where the text can either come from Serial monitor or a blutooth module. Thank You

Sure. There are examples for both MD_MAX72xx and MD_Parola libraries taking messages from the serial port and displaying them.

Hello. Is there a way for me to use the MD_MAX72xx lib to create a scrolling led matrix display from scratch where the text can either come from Serial monitor or a blutooth module. Thank You

marco_c:
Sure. There are examples for both MD_MAX72xx and MD_Parola libraries taking messages from the serial port and displaying them.

Thanks for the fast response. Can the example be modified so that when I enter a specific command the text can either speed up, slow down, brighten, or dimmed. Is there also a way to make the text come from the right side of the matrix?

Yes to all that. You will need to create some sort of message with commands that you can interpret to do what you want.

marco_c:
Yes to all that. You will need to create some sort of message with commands that you can interpret to do what you want.

Will you please guide me?

The methods for changing speed, direction, etc are all explained in the library documentation and used in many of the library examples - where a switch is pressed and the software changes something like the speed - so this should be clear.

In order to replace a physical interface (like a switch) with a software command through the serial interface you need to define what you need to send in order to make the software do what you want. This could be as simple or as complex as you want it to be. Again, there are many examples on how others have done this, especially if you search for Bluetooth interfaces.

A serial connection and a Bluetooth connection are essentially the same, as both look like a serial port from the Arduino code. Focus on using the Serial Monitor to develop and debug the code, which reduces the complexity, and then add the Bluetooth serial interface later.

EDIT: This may give you some clues: Turning a LED on and off with an Arduino, Bluetooth and Android. Part II: 2 way control | Martyn Currey

1 Like

marco_c:
Actually, you can already do the reversed text using the library :slight_smile:

Very cool, haven´t seen that option ! Thank you very much !

Hi Marco and thank you for this wonderfull librairy.

I was wondering if it possible to have a moving animated alien (as a character ie) in a scroll text ?

I've tried with custom caracters, but it seems not possible to have an animated char this way...

My second idea was to try to re use the part of the DAFTPUNL sample from MD_MAX72XX library...
But nothing appears on the screen.
I guess that the trouble occurs in the initailisation of the matrix...
I removed MD_MAX72XX mx = MD_MAX72XX(CS_PIN, MAX_DEVICES); and keep MD_Parola P = MD_Parola(CS_PIN, MAX_DEVICES);

And instead of mx references, i put P references :
mx.begin(); -->P.begin();

mx.control(MD_MAX72XX::UPDATE, MD_MAX72XX::OFF); -->P.control...
mx.clear(); --> P.clear();
for (uint8_t i=0; i<dataSize; i++)
{
mx.setColumn(idx-dataSize+i, iType ? invader1 : invader2*); --> P.setColumn...*
mx.setColumn(idx+dataSize-i-1, iType ? invader1 : invader2*); --> P.setColumn...*
* }*
But it seems that it is not that simple...
Any help would be appreciate.
Yours.