LED matrix display - MD_Parola, MD_MAX72xx and MD_MAXPanel

Look at the Parola_Fonts example. The way that the font name, text direction and message to display are stored and used will be the same technique that you use for the animation type and speed.

Hi marco,
I try to follow your suggestion, but being so suck at C, I didn't get anywhere tweaking with the code. That's alright though, this Parola matrix is just awesome, and I am so glad I had built it. (it's actually looks better at high scrolling speed, lol). Thanks marco, ur the man.

marco_c:
Look at the Parola_Fonts example. The way that the font name, text direction and message to display are stored and used will be the same technique that you use for the animation type and speed.

Marco:

When I input a text on serial monitor, it will show the words on matrix. Can you explain which part of the program that sent the inputed text to the matrix in the program? And, how can the program find the correct font on the MD_MAX72xx_font?
thanks!

Can you explain which part of the program that sent the inputed text to the matrix in the program? And, how can the program find the correct font on the MD_MAX72xx_font?

If I understand this question correctly you are asking me how the libraries work? That is a big question and really something that you can look for yourself in the source code.

If your question is more specific about a specific program, then you will need to explain the question better for me, please.

marco_c:
If I understand this question correctly you are asking me how the libraries work? That is a big question and really something that you can look for yourself in the source code.

If your question is more specific about a specific program, then you will need to explain the question better for me, please.

How can the TEXT sent from serial monitor to the LED matrix?
Also, how can the program load the font?

So that I can modify the program myself.
Thanks

Have you looked at any of the example programs?

How can the TEXT sent from serial monitor to the LED matrix?

Example program Parola_Scrolling

Also, how can the program load the font?

The program automatically uses the supplied font. If you want to define and supply your own then example program Parola_Fonts and read the documentation in the doc folder of the library release.

Marco,
I am using the Parola_Scrolling but I don't understand the program of void readSerial(void) part.
Can you explain that?

Oh.. the Parola_Scrolling example is not using MD_MAX72xx_font.h??

void readSerial(void)
{
  static uint8_t    putIndex = 0;

  while (Serial.available())
  {
    newMessage[putIndex] = (char)Serial.read();
    if ((newMessage[putIndex] == '\n') || (putIndex >= BUF_SIZE-2))    // end of message character or full buffer
    {
      // put in a message separator and end the string
      newMessage[putIndex] = '\0';
      // restart the index for next filling spree and flag we have a message waiting
      putIndex = 0;
      newMessageAvailable = true;
    }
      else
      // Just save the next char in next location
      newMessage[putIndex++];
  }
}

It takes the characters from the serial input port and puts them in a character array string. When that string is complete (the input character is '\n' or newline), it terminates the string with a null character and reset the string counters for the next input string. The function has a lot of comments that should be self explaining.

Note that the string is stored in a temporary variable newMessage while the current animation is still running. Once the animation is complete, the loop() function check the boolean newMessageAvailable. If the message is available it will copy the new message before the next animation, otherwise it uses the existing (old) string.

Oh.. the Parola_Scrolling example is not using MD_MAX72xx_font.h??

You need to be clear about the role of the MD_Parola and MD_MAX72xx libraries. Parola implements the high level animation handling for the scrolling display. MD_MAX72xx implements the required functionality to use the hardware. The fonts.h file will never be used in the Parola library as it is internal to the MD_MAX72xx library only.

Thank you for your marvelous library, Marco :smiley:

I bought 2 of these beautiful 4 by 8X8 LED modules....

http://www.ebay.com.au/itm/301410736248?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1423.l2649

I'm sorry, I tried to insert an image but am too much of a noob to work out how to. :frowning:

I set the #defines as such....

#define HW_DIG_ROWS 1
#define HW_REV_COLS 1
#define HW_REV_ROWS 1

as I want (0,0) to be on the bottom left.

I have 2 lots of four modules so eight altogether. I am using SW SPI with pins 12,11 & 10 correctly.

I have tried running the "Parola_Scrolling" example. It appears to scroll the message in EACH of the 8 modules.

I will try to explain, "Hello" starts in module 0 then "Hello" starts in module 1 then "Hello" in module 2 etc until "Hello",
at various stages, is on ALL 8 modules. The whole message scrolls in EACH module ending with module 7 last.

I HAVE read the "html" docs but am completely befuddled. I suspect I haven't set another #define somewhere.

I think my modules are the same as the one elektrax showed in message #349 except mine are 4 of them still connected.

Could someone please point me in the right direction?

Thanks in anticipation :slight_smile:

as I want (0,0) to be on the bottom left.

No, (0,0) is always at the top right. You need to map the hardware so that this is the result. Nothing will work as expected otherwise.

I have tried running the "Parola_Scrolling" example. It appears to scroll the message in EACH of the 8 modules.

You need to get the coordinates correct as per comment above before you proceed further.

Thanks for your response Marco :smiley:

First and foremost I read (many times) "New Hardware Types" with particular attention to the "Determining the type of mapping". Then I ran the HW_Mapper.

I started with the modules in, what I thought to be, a logical orientation. So I had the "<-IN OUT->" visible (and correct way up) on the PCB(s). Where (0,0) is/was is moot :slight_smile:

The HW_Mapper (I couldn't disconnect any modules (to leave one) as they appear to be hardwired connected?) didn't spell out my exact situation. Rows up was okay but pixels went left to right not right to left :frowning:

I changed ROW_SIZE from 8 to 64 as it seemed logical? (but had no effect). I assumed my modules were most like the ICSTATION_HW ones with IN on the left and OUT on the right. I got the best results with 1 1 1 (as per ICSTATION_HW).

I expected the scrolling to start on the right and scroll off on the left (as per your YouTube video) but it starts on the left and builds to the right dropping off on the right. So the first module on is the left most and the last is the right most. And, as before, EACH of the 8 modules scrolls the entire message at various stages.

Is

#define HW_DIG_ROWS 1
#define HW_REV_COLS 1
#define HW_REV_ROWS 1

the only elements that control the mapping? Or are there other defines I am not setting correctly?

My modules (with the PCB writing legible) have IN on the left. As in my first message I see the leftmost module as zero(?).

Again, thanks for your response :smiley:

Any further help would be most welcome :smiley:

Where (0,0) is/was is moot

Not at all, (0,0) is critical to all the other steps.

ROW_SIZE from 8 to 64 as it seemed logical

Again, not correct. There are only 8 rows, even in your configuration.

#define HW_DIG_ROWS 1
#define HW_REV_COLS 1
#define HW_REV_ROWS 1

Are the only elements that control the mapping., You should not need to change anything else.

The first (zero) module will be the one nearest to the IN, so ignore all the other 3 in your device. Normally they will show what is in the first module, delayed by one step. Focus on one module only (cover the others over if they confuse you) and make sure you get the right mapping.

My modules (with the PCB writing legible) have IN on the left. As in my first message I see the leftmost module as zero(?).

And if you flip it 180 degrees it will be on the right. Don't look at the writing on the PCB to work out which is up - run HW_Mapper and follow the instructions.

Scrolling direction has nothing to do with the modules and everything to do with the logic in the software. Unless you tell it the hardware configuration, it cannot logically do anything. Expecting (0,0) in the bottom right when the documentation says the top left is never going to work.

Thanks Marco. :slight_smile:

I'm not home ATM (babysitting a 2.5 year old. About MY mental age). :smiley:

I'm on my iPad. Pity I can't get the Docs on it. :frowning: It would be nice to access them away from my desktop.

Even though my current setup shows the text upright I will flip it when I get home as you suggest.

I won't swear to it but I think I HAVE tried all combinations of the 3 elements, 000, 001, 010, 011, 100, 110 & 111. The last, 111, gave (IMO) the best results. Two of them were obviously wrong as the gave either ONE row or column of blinking LEDs.

When I get home I will invert the array so the writing on the PCB is upside down and run the Mapper and try to make sense of it. I will start with a clean slate. I really want this 2 by 4 by 8X8 array to work as I will eventually buy 5 more sets. I have ordered 4 individual 8X8s modules of the same type, 2 due NOW and 2 more due in a month (coming from China). :frowning: I also have 12 generic modules. So I am serious about getting things to work.

Thanks for ALL your very welcome help, Marco.

I also have 12 generic modules.

It may be easier to get familiar with getting it to work with these as we know it should work.

Just to give you the results of the Mapper.

IN to the right of the array and lettering on the PCB upside down.

** DIGITS MAPPING (rows) **
D0 etc

Showed rows starting on the top moving down.

** SEGMENT MAPPING (columns) **
seg G etc

Showed a pixel on the top row stepping from the right to the left.

I let this run for 8 pages of A4 and the results repeated till I stopped the sketch.

I read this to be 1 1 1. Right? :astonished:

Curiously I wrote a sketch using the LedControl library. The sketch draws all sorts of patterns on each module (at random), numbers, my name LOUIS and so on.

I developed the sketch using 5 generic modules. Which (inverted to my current test) shows everything perfectly as I expected.

The sketch also includes this bit of logic....

for(addr=0; addr<5; addr++) {
lc.setLed(addr,addr,addr,true);
delay(100);
}

When I run my sketch on my 2 by 4 8X8 array, my name starts on the right but the letters go downwards to the left (as expected). The sketch shows (0,0,0,true) as the top LEFT of the rightmost module. Does this help?

Again, thanks for all your help. It is much appreciated :smiley:

I saw your suggestion about trying with the generic modules but, like a dog with a bone, I would like to keep gnawing the problem I have till I get a solution :slight_smile:

I am considering changing from software SPI to hardware SPI? Would there be an advantage to this?

I saw your suggestion about trying with the generic modules but, like a dog with a bone, I would like to keep gnawing the problem I have till I get a solution

Sometimes switching bone refreshes the palate.

I developed the sketch using 5 generic modules. Which (inverted to my current test) shows everything perfectly as I expected.

So why not do the same for the MD_MAX72xx and the generic modules? If you can get it to work for separate generic modules at least it would give you (and me) confidence that you are understanding the HW_Mapper properly. :slight_smile:

When I run my sketch on my 2 by 4 8X8 array, my name starts on the right but the letters go downwards to the left (as expected). The sketch shows (0,0,0,true) as the top LEFT of the rightmost module. Does this help?

Not if you are using LedControl.

I am considering changing from software SPI to hardware SPI? Would there be an advantage to this?

Not for this problem. The only difference will be that animation it will be much faster with MD_MAX72xx but no difference with LedControl.

  Serial.print(F("\n\nThere are three hardware setting that describe your hardware configuration:"));
  Serial.print(F("\n- HW_DIG_ROWS - HardWare DIGits are ROWS. Set to 1 if the digits map to the rows"));
  Serial.print(F("\n                of the matrix, 0 otherwise"));
  Serial.print(F("\n- HW_REV_COLS - HardWare REVerse COLumnS. The normal column coordinates orientation"));
  Serial.print(F("\n                is 0 col on the right side of the display. Set to 1 to reverse this"));
  Serial.print(F("\n                (ie, hardware 0 is on the left)."));
  Serial.print(F("\n- HW_REV_ROWS - HardWare REVerse ROWS. The normal row coordinates orientation is 0"));
  Serial.print(F("\n                row at top of the display. Set to 1 to reverse this (ie, hardware 0"));
  Serial.print(F("\n                is at the bottom)."));

Remember (0,0) is the TOP RIGHT.

Showed rows starting on the top moving down.

  Serial.print(F("\n->If you see ROWS animated then set HW_DIG_ROWS to 1."));
  Serial.print(F("\n->If you saw BARS scanning right to left (or bottom to top if"));
  Serial.print(F("\n  HW_DIG_ROWS) then set HW_REV_ROWS to 1."));

HW_DIG_ROWS = 1 as the rows are being illuminated.
Counting from 0 the rows are counting TOP to BOTTOM for an increase in the number of rows, so HW_REV_ROWS is 0.

Showed a pixel on the top row stepping from the right to the left.

  Serial.print(F("\n-> If you saw LEDS scanning bottom to top (or right"));
  Serial.print(F("\n   to left if HW_DIG_ROWS) then set HW_REV_COLS to 1."));

So HW_REV_COLS = 1 as they are already counting right to left and HW_DIG_ROWS=1.

Sorry Marco....

I typed a response and tried to send a video but "The connection got reset" and I lost the whole message and the attempt to upload a video. :frowning:

Serves me right not to copy the message first :frowning:

I set the #defines such (as suggested by your response)

#define HW_DIG_ROWS 1
#define HW_REV_COLS 1
#define HW_REV_ROWS 0

The display is much as before. :frowning:

Letters right way up but inverted. Starts rightmost - eH then next module eHll then next eHllo! etc....
Ends with "?" in the leftmost module.

I could still be doing something wrong? Misrepresenting the results of the Mapper?

Could the pins be wrong? Defined right but plugged in wrong? I HAVE checked but I am almost 70 so could be wrong!?

#define DATA 12
#define CS 10
#define CLK 11

Has anyone else used these modules successfully?

Could the modules be wired completely differently?

I will try to send a picture of the modules (won't try video as I suspect it killed the last reply)!

As always, thanks for your continuing help Marco.... :smiley:

Could the pins be wrong?

Unlikely as you would be getting nothing intelligible.

Has anyone else used these modules successfully?

Never been asked about these before. Doesn't mean they have not been connected successfully, as there are a few thousand downloads of the library.

Could the modules be wired completely differently?

Possible but you say that they work with LedControl, so they are consistent amongst themselves at least.

Letters right way up but inverted

Do you mean right way up but back to front or that the letters appear in reverse order?

I go back to asking you to please try the generic modules first and then come back to this. I KNOW the generic modules work and you should be able to get them to work as well.

It may also be useful to leave the Parola library aside for the moment and just run the MD_MAX72xx_Test example program. It tells you where it thinks zero is.

Tried to resend the video (18.9Mb) but failed again. Took another smaller one.... 8.4Mb....

8.4Mb failed. Trying 2.5Mb