Trick for 16-rows display using Parola :)

marco_c:
You have a more dynamic message. No difference.

Could you please suggest a method of passing a dynamic message into a char. I mean how can I declare my char timeStamp into a static one so that I can utilize it as a string or word which can be printed out.

P.displayText(timeStamp, ....

won't work because I tried. Is there any other way like changing the char timeStamp[] into a word or string?

Time stamp should already be an array of characters or sprintf() and print() will not work.

marco_c:
Time stamp should already be an array of characters or sprintf() and print() will not work.

Atlast I managed to scroll the time. Thanks for the guidance.

But after every scroll_left of time, the date flashes and again scrolling of time continues.

#include <Wire.h>
#include <MD_DS1307.h>
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#include <RTClib.h>


#define MAX_DEVICES 4
#define CLK_PIN   13
#define DATA_PIN  11
#define CS_PIN    10


#define MAX_DEVICES 4

#define PAUSE_TIME    3000
#define SCROLL_SPEED  30


RTC_DS1307 rtc;

//MD_Parola P = MD_Parola(DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
MD_Parola P = MD_Parola(CS_PIN, MAX_DEVICES);

void setup () 
{

  Wire.begin();
  Serial.begin(57600);
  P.begin();
  
 if(! rtc.begin()) 
  {
    Serial.println("Couldn't find RTC");
    while (1);
  }

 if(! rtc.isrunning()) 
  {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
     rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    
  }

}
void loop () 

{

DateTime now = rtc.now();
     
char timeStamp[15];
char dateStamp[15];

sprintf(timeStamp, "%d:%d", now.hour() ,now.minute());

Serial.println(timeStamp);
    
sprintf(dateStamp, "%d/%d",  now.day(),now.month());   
  
Serial.println(dateStamp);


 for (uint8_t i=0; i<ARRAY_SIZE(timeStamp); i++)
 
    {

       P.displayText(timeStamp, PA_CENTER, SCROLL_SPEED, PAUSE_TIME, PA_PRINT, PA_SCROLL_LEFT);
   
     
      while (!P.displayAnimate())
      
      ;
    
      break;
      
    }


P.print(dateStamp);

}

The looping continues with flashing date after every scroll_left.

I am planning to scroll the date after the timeloop finishes.

vijithcv:
Atlast I managed to scroll the time. Thanks for the guidance.

The looping continues with flashing date after every scroll_left.

I am planning to scroll the date after the timeloop finishes.

Atlast this is what I came up with. Please let me know if I can simplify the program. But anyhow it works. Hope new year will become 01/01/2018 :wink:

#include <Wire.h>
#include <MD_DS1307.h>
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#include <RTClib.h>


#define MAX_DEVICES 4
#define CLK_PIN   13
#define DATA_PIN  11
#define CS_PIN    10


#define MAX_DEVICES 4

#define PAUSE_TIME    3000
#define SCROLL_SPEED  30


RTC_DS1307 rtc;

//MD_Parola P = MD_Parola(DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
MD_Parola P = MD_Parola(CS_PIN, MAX_DEVICES);

void setup () 
{

  Wire.begin();
  Serial.begin(57600);
  P.begin();
  
 if(! rtc.begin()) 
  {
    Serial.println("Couldn't find RTC");
    while (1);
  }

 if(! rtc.isrunning()) 
  {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
     rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    
  }

}
void loop () 

{

DateTime now = rtc.now();
     
char timeStamp[15];
char dateStamp[15];



sprintf(timeStamp, "%02d:%02d", now.hour() ,now.minute());

Serial.println(timeStamp);
    
sprintf(dateStamp, "%02d/%02d",  now.day(),now.month());   
  
Serial.println(dateStamp);



 for (uint8_t i=0; i<ARRAY_SIZE(timeStamp); i++)
 
    {
P.displayText(timeStamp, PA_CENTER, SCROLL_SPEED, PAUSE_TIME, PA_PRINT, PA_MESH);
P.displayAnimate();

 while (!P.displayAnimate())
      
      ;
    
      break;
      
    }
    
 for (uint8_t q=0; q<ARRAY_SIZE(timeStamp); q++)
 
    {



 int dow = now.dayOfTheWeek();                
 char *d   ;                          
  switch(dow)
  {
     case 1:
     Serial.println("MON");
     d = "MON";
    
     break;
     
     case 2:
     Serial.println("TUE");
    
    d = "TUE";
 
     break;
     case 3:
     
     Serial.println("WED");
     

  d = "WED";
  
     break;
     case 4:
     
     Serial.println("THU");
     
    d = "THU";
    
     break;
     case 5:
     
     Serial.println("FRI");
     
   d = "FRI";
   
     break;
     case 6:
   Serial.println("SAT");
  
   d = "SAT";
   
     break;
     case 0:
     
     Serial.println("SUN");
     
   d = "SUN";
     break;
     }
    

P.displayText(d, PA_CENTER, SCROLL_SPEED, PAUSE_TIME, PA_PRINT, PA_BLINDS);
P.displayAnimate();

 while (!P.displayAnimate())
      
      ;
    
      break;
      
    }



for (uint8_t j=0; j<ARRAY_SIZE(dateStamp); j++)
{

 P.displayText(dateStamp, PA_CENTER, SCROLL_SPEED, PAUSE_TIME, PA_PRINT, PA_SCROLL_LEFT);
   
     
      while (!P.displayAnimate())
      
      ;
    
      break;
      
    }


for (uint8_t r=0; r<ARRAY_SIZE(dateStamp); r++)
 
    {


 int moy = now.month();                
 char *e   ;    
                      
  switch(moy)
  {
     case 1:
     Serial.println("JAN");
    e = "JAN";
    
     break;
     
     case 2:
     Serial.println("FEB");
    
   e = "FEB";
 
     break;

     case 3:
     
     Serial.println("MAR");
     

  e = "MAR";
  
     break;

     case 4:
     
     Serial.println("APR");
     
    e = "APR";
    
     break;

     case 5:
     
     Serial.println("MAY");
     
   e = "MAY";
   
     break;


     case 6:
   Serial.println("JUN");
  
   e = "JUN";
   
     break;

     case 7:
     
     Serial.println("JUL");
     
   e = "JUL";
     break;


case 8:
     
     Serial.println("AUG");
     
   e = "AUG";
     break;

case 9:
     
     Serial.println("SEP");
     
   e = "SEP";
     break;

case 10:
     
     Serial.println("OCT");
     
   e = "OCT";
     break;

case 11:
     
     Serial.println("NOV");
     
   e = "NOV";
     break;

case 12:
     
     Serial.println("DEC");
     
   e = "DEC";
     break;

     }
    

P.displayText(e, PA_CENTER, SCROLL_SPEED, PAUSE_TIME, PA_PRINT, PA_SCAN_HORIZ);
P.displayAnimate();

 while (!P.displayAnimate())
      
      ;
    
      break;
      
    }

 
for (uint8_t k=0; k<ARRAY_SIZE(dateStamp); k++)
{
  int iVarToCast = now.year();
  char buffer[4];
  dtostrf(iVarToCast, 4, 0, buffer);
  

P.displayText(buffer, PA_CENTER, SCROLL_SPEED, PAUSE_TIME, PA_PRINT, PA_SCROLL_LEFT);
Serial.println(buffer);

 while (!P.displayAnimate())
      
      ;
    
      break;
      
    }
}

vijithcv:
Atlast this is what I came up with. Please let me know if I can simplify the program. But anyhow it works. Hope new year will become 01/01/2018 :wink:

Everything works except two issues.

  1. The Week and Month name is clipped if I use the scroll function. Eg: It shows only Januar and while it scrolls it doesn't display the remaining.

  2. The seconds doesn't increment while I enable the Parola scroll or any other animation. Its like the current second is saved in the char array and its displaying that value at that instant only.

I added a LM35 Sensor and I face the same issue wherein the temperature is not displayed real time. If there is any increase in temperature its displayed in the next animation sequence. Its also like frozen.

I think when the value is put into a char array and while using Parola library it shows the value as a word and any change in the value is shown in the next cycle of animation.

I hope i made my problem little bit clear.

Anyway it keeps the time and temperature day and date properly. Only minus I am not getting a live display.

nyc work sir....i'm also trying lyk this...
Total 32 (8x8)matrices taken as 2 zones.....
0-15 Bottom zone,
16-31 TopZone.

Here my problem is the two zones are not synchronized eachother...When i increse the scrolling speed,the bottom zone move forward than upperzone...they not synchronized..
please help me...
give me suggetions...

thanq,
Sankar.

Hello, I am getting error that 'CENTER' is not declared in the scope. Please help me. My matrix display is 16 (height) x 64 (length). Please help me with coding.

Seriously?

enum textPosition_t
{
  PA_LEFT,    ///< The leftmost column for the first character will be on the left side of the display
  PA_CENTER,  ///< The text will be placed with equal number of blank display columns either side
  PA_RIGHT    ///< The rightmost column of the last character will be on the right side of the display
};

Please read the documentation supplied with the library and/or the header files. We will all find it less frustrating.

hi .. can help post example coding? i have 16x32 matrix.

Hi! i was testing the code from the beginning of this thread and by the way i am using 16 modules of LED matrix divided in 2 zones. my issue is that the first module of the project is dim can you help me fix this one?