Go Down

Topic: LED matrix display - MD_Parola, MD_MAX72xx and MD_MAXPanel (Read 522047 times) previous topic - next topic

marco_c

@kinburn77 - I have not seen this specific type of issues before (works one way not the other), but generally problems like this are related to inadequate wiring, power supply and/or signal conditioning in a string this long (40 modules).

One way to determine what is going on is to reduce the number of matrices (starting at one set) and increase to see when the problem reappears (2, 3, 4, 5?), or swap the position of the modules and see if the fault follows the module (hardware problem).
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Hi,

I'd like to ask what is the correct way to add a new HW type without loosing it on the next update.
Let me add the context, I got a bunch of 788BS matrices from ebay (datasheet) witch are smaller than the 'normal' type you got with pre-assembled modules.

I assembled one with a MAX7219 IC and an Arduino Nano.

Using MD_MAX72xx_HW_Mapper I got:
   HW_DIG_ROWS 0
   HW_REV_COLS 0
   HW_REV_ROWS 1
Witch does not mach any standard hw type.

In order to use it I did this
On file MD_MAX72xx.h
Code: [Select]
 enum moduleType_t
  {
    PAROLA_HW,    ///< Use the Parola style hardware modules.
    GENERIC_HW,   ///< Use 'generic' style hardware modules commonly available.
    ICSTATION_HW, ///< Use ICStation style hardware module.
    FC16_HW,      ///< Use FC-16 style hardware module.
    M788BS_HW     ///< Use a 788BS matrix <<<<<<<<<<<<<<<<<<
  };


And on file MD_MAX72xx.cpp
Code: [Select]
 _mod = mod;
  switch (_mod)
  {
    case PAROLA_HW:    _hwDigRows = true;  _hwRevCols = true;  _hwRevRows = false; break; // tested MC 8 March 2014
    case GENERIC_HW:   _hwDigRows = false; _hwRevCols = true;  _hwRevRows = false; break; // tested MC 9 March 2014
    case ICSTATION_HW: _hwDigRows = true;  _hwRevCols = true;  _hwRevRows = true;  break; // tested MC 9 March 2014
    case FC16_HW:      _hwDigRows = true;  _hwRevCols = false; _hwRevRows = false; break; // tested MC 23 Feb 2015
    case M788BS_HW:    _hwDigRows = false; _hwRevCols = true;  _hwRevRows = true;  break; // tested ocsav 4 May 2019
    default:           _hwDigRows = _hwRevRows = _hwRevCols = false; break;   // not a known board config
  }


However, looking at your comments it looks that I should be using USE_HW_OTHER, however I was not able to find out how to do this, I'm sure it is my fault, but I ask for help here.

Right now I have it running MD_MAX72xx_Pacman.ino with
Code: [Select]
#define HARDWARE_TYPE MD_MAX72XX::M788BS_HW
#define MAX_DEVICES 1
#define CLK_PIN   13  // or SCK
#define DATA_PIN  11  // or MOSI
#define CS_PIN    10  // or SS


Here is a pic of this matrix running MD_MAX72XX_Pacman side by side with a FC16 module.
--
You never learn anything by doing it right.

marco_c

If you use HW_OTHER then you need to edit the _lib.h to have set
Code: [Select]
   HW_DIG_ROWS 0
   HW_REV_COLS 0
   HW_REV_ROWS 1

in the HW_OTHER section to matches your 'new' hardware.

Either the way you did it or using HW_OTHER does not survive a library upgrade, which is why the newer version of the library does away with HW_OTHER and allows you to set your hardware from a predefined list only.

In the new library you will need to set the internal variables for REV_COLS, REV_ROWS and DIG_ROWS in (I thin) the begin() method. This then works as before.

For a library upgrade to retain your new hardware across the upgrade the new hardware to be included in the library distribution. I don't do that for non-commercial hardware as it would be a special for one user out of thousands.

Hopefully this answers your question.

Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Ok, I thought that there was a way to doit and I was missing something.
I don't really understand why there are different hardware types, is it a question of the matrix each maker uses ? I just took the datasheet for the matrix I have (788BS) and the max7219 and start connecting wires, I made no design decision but if I could (or know how) I would have made it to mach one of the pre-existing types.

--
You never learn anything by doing it right.

marco_c

See my blog site. Search for "Parola A to Z" and read the "adapting for different hardware" article.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Joppnl

Hello Marco,

thank you for your work on this library, I got it all working and it's great fun.

After the playing comes the 'wanting-to-understand- phase and no matter where I look, I can not find the basics of the library.

What I am looking for is: which commands are possible with what parameters and what do the do?

I spent hour trying to find it...but I can not (tried to go through the docs coming with the zip-lib, looked into git-hub, your blog, wild-searching the web....nu cucces).

I.e. (but just as an example):

where can I find explanation about this command:

  P.displayText(text, PA_LEFT, 30, 30, PA_SCROLL_LEFT, PA_SCROLL_LEFT);

Now...it's not about this command but in general: which commands are possible and what parameters are used.

Is this information available??

Thank you!

marco_c

The library reference is in the docs folder (open index.html). Many of the parameters are enumerated types that have a restricted choice, but you need to look at the enumeration declaration to see what they are.

The library examples try and show how the functions are used to achieve a task.

The blogs try and explain some of the thinking around how the library works.

If all of that is not enough (and that is already a ton more than for most libraries), then you need to study the code to see how it works, as there is nothing else.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Joppnl

Thank you Marco,

I think I found something as a start (the displayText example).

Yeserday I also went through these library docs well...new day and your directions ...lots of stuff to try and explore and discover, thanks!

eboyid

Hello everyone, I'm get a little trouble here.

I always get an error message every MD_MAXPanel included. Like this :

Quote
In file included from D:\Arduino\Matrix_Coba1\Matrix_Coba1.ino:1:0:

D:\Arduino\libraries\MD_MAXPanel\src/MD_MAXPanel.h:158:40: error: expected ')' before 'mod'

   MD_MAXPanel(MD_MAX72XX::moduleType_t mod, uint8_t dataPin, uint8_t clkPin, uint8_t csPin, uint8_t xDevices, uint8_t yDevices);

                                        ^

In file included from D:\Arduino\Matrix_Coba1\Matrix_Coba1.ino:1:0:

D:\Arduino\libraries\MD_MAXPanel\src/MD_MAXPanel.h:174:40: error: expected ')' before 'mod'

   MD_MAXPanel(MD_MAX72XX::moduleType_t mod, uint8_t csPin, uint8_t xDevices, uint8_t yDevices);

                                        ^

D:\Arduino\libraries\MD_MAXPanel\src/MD_MAXPanel.h: In member function 'uint16_t MD_MAXPanel::getFontHeight()':

D:\Arduino\libraries\MD_MAXPanel\src/MD_MAXPanel.h:581:45: error: 'class MD_MAX72XX' has no member named 'getFontHeight'

   uint16_t getFontHeight(void) { return(_D->getFontHeight()); }

                                             ^

exit status 1
Error compiling for board Arduino NG or older.
I used Arduino Saverino V3, Arduino 1.8.9 IDE

anyone can help me? Explain this :D

marco_c

Please post your code. You have some sort of error in your code.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Nealix

Hi:

I have a nice working matrix clock.  I am using the MD_MAX72XX library.
I display local time on row one, like:  "PST 16 MAY 20:55:27"
and the temperature and humidity on row two, like:  "TEMP: 68 F    RH: 50%"

For the temperature, how can I add the DEGREE symbol between the value, 68 here,
and the "F" for Farenheit?


I am using sprintf to format both row strings before printing to the matrix.
I studied the library and in MD_MAX72xx_font.cpp, I did find a line in the font
table like this;        5, 0x06, 0x0f, 0x09, 0x0f, 0x06,  // 247 - 'Degree'
But I am not sure how to reference that from my sprintf statement?

Snippets of my code;

Code: [Select]


#include <MD_MAX72xx.h> 

// MAX7219 Matrix Defines:
// Arduino SPI HW interface first;
#define DATA_PIN                11      // or MOSI
#define CLK_PIN                  13      // or SCK
#define CS_PIN_MX1            10      // SS/CS for first matrix row
#define CS_PIN_MX2              7      // SS/CS for second matrix row
#define MAX_DEVICES_MX1  12                     // How many 8x8 matrix modules in this string?
#define MAX_DEVICES_MX2  12                     // How many 8x8 matrix modules in this string?
#define HARDWARE_TYPE    MD_MAX72XX::FC16_HW    // Type of matrix module hardware

// Here we set the contents of each row;
    // sprintf the temp and humidity
    // First, convert floats to char strings, since sprintf() does not do floats.
    char f_temp[6];  // char string scratch for temperature conversion.
    char h_temp[6];  // char string scratch for humidity conversion.
    dtostrf(f, 2, 0, f_temp);  // float "t" goes into char string f_temp.
    dtostrf(h, 2, 0, h_temp);  // float "h" goes into char string h_temp.
    sprintf(message, "TEMP: %s F  RH: %s%%", f_temp, h_temp);

// QUESTION:  How do I insert the degree symbol above between %s and F
// Send the string to the LED Matrix "MX1"
 printToMatrix(0, MAX_DEVICES_MX1-1, message, mx1);



// Below works fine for time, row 2;
// Next, print Local Time on LED Matrix MX2.
//
 time_t loc = LocalTime();   // Get Local time, adjusted for DST, in var "loc"
 int mloc = month(loc);
 sprintf(message, "PST %02d %s %02d%c%02d%c%02d", day(loc), monthShortStr(mloc), hour(loc),
                 ':', minute(loc), ':', second(loc));
 printToMatrix(0, MAX_DEVICES_MX2-1, message, mx2);




Thanks for any guidance or ideas.

Neal

marco_c

Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

ScottJ2505

Hi Marco_C,

I would like the display to turn on and off at certain times (i.e., go blank).  I can get the display to turn on at a certain time but I cannot get the display to go blank.  Any ideas?

Thank you,
Scott

Nealix

Look up "C escape sequence"
Ah, thank you.
So if I understand you correctly;

The library font table shows; 
5, 0x06, 0x0f, 0x09, 0x0f, 0x06,  // 247 - 'Degree'
for the degree symbol.  So is that CHAR 247 for degree symbol?

So would I change my existng line;

       sprintf(message, "TEMP: %s F  RH: %s%%", f_temp, h_temp);

into this new line;

       sprintf(message, "TEMP: %s%cF  RH: %s%%", (CHAR)247, f_temp, h_temp);
     
Am I on the right track?

Cheers

marco_c

@ScottJ2505: I assume you are referring to using the MD_Parola library, but you don't say. Either give it an empty string, don't reset the animation after it has scrolled off the display, use the displayShutdown() method, set the intensity to 0 or just clear the display. It all depends on what you are doing this for. Please find and read the documentation in the docs folder (open index.html) if you have not already done this as all this info is in there.

@Nealix: I would be (char) not (CHAR), but you can also just specify the character code in hex using the \xnn syntax in the format string. Anyway, why not just try it - does it work?
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Go Up