Go Down

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

marco_c

You probably also need to check loop indexes and function parameters at a minimum.

Also, the font table is all uint8_t type, how are you going to store a number larger that 255?
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Ysayyed

Thank you marco for your kind reply. Can you please point out which loop indexes and function parameters i have to check. Yes you are right the font table is uint8_t type. I am thinking to use 16bit short or int which uses 2 bytes of the disk space and provide a wide range of values from -32768 to 32767. Am i right in this selection or not??

One more thing i am following your criteria of defining bytes for the font table i.e. 1, 2, 4, 8, 16, 32, 64, 128 so the total becomes 255. But, the problem with short or int is that I have to start from 128 which will reach upto 16384 and the total is still 32640. Will this still work or not ??

Any clues how can i get the correct match ?

marco_c

Quote
Can you please point out which loop indexes and function parameters i have to check
No I can't. As I have told you in another forum, you need to look at the code, understand what it does and evaluate whether the changes you have made will affect the code or not. Without actually doing that myself, I can't tell you where you will need to change things. I also pointed out this is not a newbie type project unless you have programmed somewhere else before.

Quote
-32768 to 32767
You actually need to have 0 to 65535. It makes no sense for characters to be negative numbers.

Quote
Will this still work or not ??
I don't understand what you are trying to explain.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

vader7071

I was wondering if it is possible to address an 8x8 matrix alone.

What I am hoping to do:  (5) 7219 chips side by side, scrolling a message.  Then have (2) 7219 chips displaying random data.  These 7219's will be connected to 8x8 LED matrices.

I can place the extra (2) either at the front or end of the chain, that won't be an issue.
Creatively engineering consent since 1976.

marco_c

Yes you can. The Parola_Zone_Sign example is probably already quite close to what you are describing.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

vader7071

Yes you can. The Parola_Zone_Sign example is probably already quite close to what you are describing.
Thank you!  I am looking at the example now.

If I am reading the example correctly, it is set to do 3 zones? (using the "p.setzone")

Is there a tutorial on this setup that I can read up on?
Creatively engineering consent since 1976.

marco_c

Documentation for all my libraries is in their respective docs folder.

Links to a few videos showing the library in use from the README file on github or in the library folder.

Parola blogs are on my blog site, link below. Search for "Parola A to Z".
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Ysayyed

Hi marco,

Thanks for your valuable time and interest to answer my questions. My problem is somewhat solved with your double height display examples. But, now I got stucked in another problem, it goes like follows:

I am trying to make a double height display. The data is to be fetched from sd card (Because, the text strings exceeds the limit of character as you shown in example of double height display also it is not a single paragraph. There is a series of different messages which are stored in sd card namely 1.txt, 2.txt, 3.txt). You have made two fonts for two zones namely BigFontLower and BigFontUpper. I, am able to read the data for a single zone (As shown in sd card example). But, i am unable to read .text file from sd card for double height zone display. Please help me in this.


marco_c

Quote
i am unable to read .text file from sd card for double height zone display
If you are unable to read the text from an SD card this is not a problem with the Parola library, especially if it already works for the standard normal font size sd card example.

I would suggest that you create a small test program that reads a text file from the sd card and displays it to the serial monitor. Once you have worked out how this can be made to work you can extent it into the double height example. If your test program does not work then there is more chance of getting help for it in the main Programming forum, where there is a bigger audience.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Ysayyed

Hi marco,

As you suggested me to make an test program of reading string from sd card for single module. I made it and successfully implemented it. I succesfully implemented code for single module using MD_MAX72xx.h. but now i am trying it to implement double zone example on MD_Parola.h. But getting some problems. Here is the code for reference:

Code: [Select]

#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#include <SD.h>
#include "Fonts.h"
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES (ZONE_SIZE*MAX_ZONES)
#define ZONE_SIZE 4
#define MAX_ZONES 2

#define CLK_PIN   52
#define DATA_PIN  51
#define CS_PIN    9

#define ZONE_LOWER 0
#define ZONE_UPPER 1

const int chipSelect = 53;


// Hardware SPI connection
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
// Arbitrary output pins
// MD_Parola P = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);

#define SPEED_TIME  25
#define PAUSE_TIME  1000

// Turn on debug statements to the serial output
#define  DEBUG  0

#if  DEBUG
#define PRINT(s, x) { Serial.print(F(s)); Serial.print(x); }
#define PRINTS(x) Serial.print(F(x))
#define PRINTX(x) Serial.println(x, HEX)
#else
#define PRINT(s, x)
#define PRINTS(x)
#define PRINTX(x)
#endif

// Global variables
#define ARRAY_SIZE(x)  (sizeof(x)/sizeof(x[0]))
File  myfile;
// Global data
typedef struct
{
  textEffect_t effect; // text effect to display
  File  myfile;    // text string nul terminated
  uint16_t     speed;  // speed multiplier of library default
  uint16_t     pause;  // pause multiplier for library default
} Scroll_Data;

typedef struct
{
  uint8_t zone;
  File  myfile;
  textPosition_t  align;
  uint16_t  speed;
  uint16_t  pause;
  textEffect_t  effectIn;
  textEffect_t  effectOut; 
} Scroll_Effect;

void  D (Scroll_Effect);

Scroll_Data Sdata[] =
{
  { PA_SCROLL_LEFT, myfile,  5, 1 },
};

void setup(void)
{
#if DEBUG
  Serial.begin(57600);
 while (!Serial) {
    ;
  }
  Serial.print("Initializing SD card...");
  if (!SD.begin(chipSelect)) {
    Serial.println("Card failed, or not present");
    while (1);
  }
  Serial.println("card initialized.");
  myfile = SD.open("msg.txt");
  if (myfile) {
    while (myfile.available()) {
      P.write(myfile.read());
    }
    myfile.close();
  }
  else {
    Serial.println("error opening datalog.txt");
  }
#endif

  P.begin(MAX_DEVICES);
  P.setInvert(false);

  for (uint8_t i=0; i<ARRAY_SIZE(Sdata); i++)
  {
    Sdata[i].speed *= P.getSpeed();     // use the library defaults as multiplier
    Sdata[i].pause *= 0;
  }

  P.setZone(0, 0, 3);
  P.setFont(0, BigFontLower);
  P.setZone(1, 4, 7);
  P.setFont(1, BigFontUpper);
  P.setCharSpacing(P.getCharSpacing() * 2);
}

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

  // animates and returns true when an animation is completed. These are synchronised, so assume they are all done.
  if (P.displayAnimate())
  if (P.getZoneStatus(0) && P.getZoneStatus(1))
  {
    for (uint8_t z=0; z<MAX_ZONES; z++)
    D (z, Sdata[mIdx].myfile, PA_LEFT, Sdata[mIdx].speed, Sdata[mIdx].pause, Sdata[mIdx].effect, Sdata[mIdx].effect);
    mIdx = (mIdx + 1) % ARRAY_SIZE(Sdata);
    P.displayClear();
    P.synchZoneStart();
  }
}



And I am getting this error message;

Arduino: 1.8.9 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\Desktop\Test\Test\Parola_Zone_SD\Parola_Zone_SD.ino: In function 'void loop()':

Parola_Zone_SD:134:116: error: could not convert 'z' from 'uint8_t {aka unsigned char}' to 'Scroll_Effect'

     D (z, Sdata[mIdx].myfile, PA_LEFT, Sdata[mIdx].speed, Sdata[mIdx].pause, Sdata[mIdx].effect, Sdata[mIdx].effect);

                                                                                                                    ^

Using library MD_Parola at version 3.1.1 in folder: C:\Users\Documents\Arduino\libraries\MD_Parola
Using library MD_MAX72XX at version 3.1.0 in folder: C:\Users\Documents\Arduino\libraries\MD_MAX72XX
Using library SPI at version 1.0 in folder: D:\Arduino\hardware\arduino\avr\libraries\SPI
Using library SD at version 1.2.3 in folder: D:\Arduino\libraries\SD
exit status 1
could not convert 'z' from 'uint8_t {aka unsigned char}' to 'Scroll_Effect'


Help!!

marco_c

Code: [Select]
D (z, Sdata[mIdx].myfile, PA_LEFT, Sdata[mIdx].speed, Sdata[mIdx].pause, Sdata[mIdx].effect, Sdata[mIdx].effect);
This is meaningless line (as the compiler is telling you, what is D?). I think you have corrupted the example program.

The method is displayZoneText().
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Ysayyed

P.displayZoneText syntax is (z,  *Text, align, speed, pause, effect in, effectOut) right.
When i place myfile (which is actually sdlib file) in place of *Text it is giving error that cannot convert sdlib file to const char. Therefore i made a tydef struct of my own and try to call that from function D. But the compiler shows this error as given above.
Is there anyway to add a function such as displayZoneText and its syntax replacing *Text to sdlib file ?

marco_c

Not in the Parola library. To display a file you need to write a separate function that will read the file into a text string (char array) and then display that using the methods from the library.

A file is not a text string and the conversion is never automatic.

If you are trying to just display a file continuous by scrolling (ie no other special effects) then you might be better off using the MD_MAX72xx library directly. There are a couple of examples there to scroll text. They only deal with one character at a time when it enters the display. This may suit reading a file when you need the next character rather than trying to load the file all at once.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Ysayyed

Is there any way to setzone and setfont for the zone in Md_max72xx.h? (As we used to do in setzone and setfont in md_parola.h ) Another question is : can we convert the sdlib file to char type for storing contents of sd card in char array like :

File myfile;
Char *mymsg = 0;

mymsg = myfile.read();

And then pass this declaration in displayzonetext ();??

marco_c

Everything supported is listed in the library documentation. Please read it.

You can write a function to read a file into a memory string, but you need to write it. Are you sure you have enough memory?
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Go Up