Question regarding "MD_Parola.h" & MAX7219 8x32

Hello everybody...

I am an absolute newbie with some knowledge of C++... and I would like to raise a question regarding "MD_Parola.h" in combination with a MAX7219 8x32 LED matrix display using an Arduino Nano.

Is it absolutely necessary to use "MD_Parola.h" or can I do without it, by just using the "MD_MAX72xx.h" library to display whatever needs to be shown.

The project is a weather station and I'd prefer it without fancy scrolling texts or other things. I just want it to simply show the barebone information.

Basically, it just needs to show " T 32c" for a few seconds, " H 58%" for a few seconds and finally "P 1005mb" also for a few seconds. (and then re-start with the temperature "T")

So far there is no algorithm available (except in my mind) ... but I will certainly use some bits of the codes I have seen here and there on the internet.

Thanks in advance for your help and have a great day (or evening ... or night ...)

Regards,
E.

1. What is 8x32?
Each LED matrix Module contains 8x8 LED Array (Fig-1). How many of them you want to connect together - 4 (8x8) of Fig-2 or more?

image
Figure-1:

image
Figure-2:

2. Please, mention the type number of your Temperature and Humidity Sensor?

3. Please, post the codes that you have tried?

4.

If you use the Library, your programming tasks would be easier.

Hello,
Thanks for your response,

the matrix is as figure 2
The Temperature sensor is a BME280
And for the code... I did not have the time to look into that yet but I have a pretty good idea how it should look like... (Work keeps me busy and wife/kids/dog too (ha ha ha))

So without the library ("MD_Parola.h"), things will get more complicated...

Is there a "MD_Parola.h" "LIGHT" version?
I fear that the footprint of this library will not allow me to add anything else in the NANO.

The Parola library adds the fancy scrolling and sprtes to the max_72xx library. If you dont want the scrolling you don't need the Parola library.

1. Have you purchased the gadgets - NANO, BME280, and 4x8x8 LED matrix display Unit?

2. Please, post the picture of your BME280 sensor.

3.

The mentioned Library works well with UNO; so, it will also work with NANO.

4.

What does that mean?

Hello groundFungus,
Thank you so much for the info... That is exactly what I need to know.

So, If I understand clearly, in a nutshell, the MAX_72xx library is enough to make a text appear on the matrix.
:slightly_smiling_face:

The components are in the post. They will arrive quite soon, in the next few days.

Regarding the footprint,
The NANO has a small memory... and the "MD_Parola.h" is big... so I fear that the library takes most of the NANO's memory.

BUT.... if I do not need the "MD_Parola.h" library, then everything is fine...

(Happy days)

1 Like

Look at the examples. At least one shows how to do a simple print.

@ericvill

Here is said example on Wokwi

Compiles at

Sketch uses 5682 bytes (18%) of program storage space. Maximum is 30720 bytes.
Global variables use 84 bytes (4%) of dynamic memory, leaving 1964 bytes for local variables. Maximum is 2048 bytes.

Much better than the MD_Parola library at

Sketch uses 20910 bytes (68%) of program storage space. Maximum is 30720 bytes.
Global variables use 288 bytes (14%) of dynamic memory, leaving 1760 bytes for local variables. Maximum is 2048 bytes.

The downside however is that the MAX72xx code is not really for beginners :frowning_face:

You do not need MD_Parola to create simple messages.

If you want to save memory using MD_Parola, see this blog post Parola A to Z – Optimizing Flash Memory – Arduino++ (wordpress.com)

If you want to just use MD_MAX72xx see the example MD_MAX72xx_Printext. You can reuse the function printText() in your code.

@indev2
Great, thank you for this,
I just had a look and it seems to be exactly what I am searching for.
Now, I will have to integrate the readings of the BME280 into the sketch and have happy days watching temperature, air pressure and humidity go up and down...

Regarding the MAX72xx, somehow, I will manage to get it show what I want ...
(else I come back here and bother everybody again... ha ha ha)

@marco_c
Thank you for your precious addition...

This will be my second project.
The first is a PM2.5 meter which works perfectly, also using a NANO and a DSM501A air quality module with 9 LEDs of different colors showing also the tendency (go up or down) of the particles in the air. My readings correspond with what the internet sais for my region.

Eventually, I want to build a whole weather station and get my daughter (12 years old) to leave the screen of her mobile phone --- get her interested in something else such as making LEDs blink, have a text showing on a matrix module...

NOTE regarding the Arduino NANO and the DSM501A air quality module.

With a lot of try and error, I found out that the DSM501A air quality module does not work well when sourcing its power from the Arduino NANO. I had to use 2 power supplies (2x mobile phone chargers (2x1.5W)) to get correct readings.

@groundFungus
@GolamMostafa
@indev2
@marco_c

again, thank you all for your help.

My project works like a charm.
If one day we meet, I pay for the Pizza...

I somehow squeezed everything inside the NANO...
(Sketch uses 30694 bytes (99%) of program storage space. Maximum is 30720 bytes.)

and below is my Sketch...
(I know, it is somebody else's Sketch which was written for an UNO ... BUT, I managed to adapt it to fit into the NANO...)


Note that I used an old MD_Parola library which was smaller than the most recent one.
Newest: MD_Parola version 3.7.3
The one I used... version 3.5.4 (slightly smaller footprint)




#include <Wire.h>
#include <MD_MAX72xx.h>
#include <MD_Parola.h>
#include <SPI.h>
#include <Adafruit_BME280.h>
MD_Parola disp = MD_Parola(MD_MAX72XX::FC16_HW, 10, 4);
Adafruit_BME280 bme;
int temp, hum, pres; String tempString, humString, presString;
void setup(){
  disp.begin(); bme.begin(0x76, &Wire);
}
void loop(){
  disp.print(" *");
  delay(45);
  disp.print("  *");
  delay(45);
  disp.print("   *");
  delay(45);
  disp.print("    *");
  delay(45);
  disp.print("     *");
  delay(45);
  disp.print("      *");
  delay(45);
  disp.print("");
  delay(350);
  disp.print("  Temp");
  delay(1000);
  for(int i=1; i<=7; i++)
  {
    temp = bme.readTemperature();
    temp = temp-4;
    tempString  = "   " + String(temp)+" c";
    disp.print(tempString);
    delay(1000);
  }
  disp.print("");
  delay(350);
  disp.print("  Humid");
  delay(1000);
  for(int i=1; i<=7; i++)
  {
    hum = bme.readHumidity();
    humString = "  " + String(hum)+" %";
    disp.print(humString);
    delay(1000);
  }
  disp.print("");
  delay(350);
  disp.print(" Air Pr");
  delay(1000);
  for(int i=1; i<=7; i++)
  {
    pres = bme.seaLevelForAltitude(364, bme.readPressure())/100;  //MaeOn, Thailand, altitude 364m abovesealevel
    presString = String(pres)+" H";
    disp.print(presString);
    delay(1000);
  }
    disp.print("");
    delay(350);
}

I would like to post a picture of my construction, but I somehow cannot upload a picture.
BUT I guess, you can imagine how it looks like...

AND my daughter was mildly interested in what I was doing... It kept her away from her phone for .... maybe 1 hour....

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

In my experience the easiest way to tidy up the code and add the code tags is as follows

Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.

Thanks for the hint...

I think it looks good now.

If anybody has an idea how to make the Sketch better... please do not hesitate ...

Thank you so much ...

(HAPPY NEWBEE)

Thanks for adding the code tags

Great that it works to your satisfaction.

Thanks for sharing the finished code.

Hello all...

If you have an idea on how to make my code better (how to reduce its overall footprint), please feel free to give me hints...
As told, I am a complete newbie in the world of Arduino... and I think I got hooked.

Thanks in advance,

E.

@UkHeliBob

Hello UkHeliBob,
Won't adding tags (// bla bla bla) increase the footprint of the code?

Thanks for a reply,
E.

Not Bob, but code tags (posting code in a code block) mskes it easy to copy the code to our local IDE or other text editor for formatting or examination. Doing the copy any other way is a pain in the bottom. The convenience is worth any few extra bytes.

Also:
Always use code tags (<CODE/>) when posting code or compiler error messages.
Using code tags makes the code easier to read and easy to copy. Not using code tags means some of the code gets displayed with smiley faces and other stuff that should not be there. Be aware that there is a limit of 120000 characters for a post. If your code takes you above this limit then you can add your .ino file as an attachment. However, it will be much easier to help you if you can write a short program that illustrates the problem you are having and post that.

Please don't post an image of code instead of the code itself, or an image of error messages instead of the error messages themselves.