Thanks for replying. I wanted to make a clock which will have scrolling up animation for the digits of the time. Let me explain, for example , the time is 10:30:57 , the matrix display will show the time and then when the seconds change from 57 to 58 it will scroll up the digit in one's place i.e. 7 scrolled up and 8 will take its place, and so on for the entire time screen, then I wanted to change the replace the entire time screen(probably after 3 seconds) and then display calender.
And yes I wanted to use the MD_Parola because its fantastic and so easy to use. So far I have tried various things :-
- Firstly I used a string to display time but it scrolled up entirely obviously . LOL. I meant like this :-
String timeString = formatTime(now.hour(), now.minute(), now.second());
matrix.displayText(timeString.c_str(), PA_CENTER, 0, 0, PA_PRINT, PA_NO_EFFECT);
This was my first attempt at doing this and obviously at this point I didn't knew much about zones.
- Then I used sprintf to break the timestring and then display the components(hour, minute and seconds) individually but they also resulted in more or less the same output as the first code, here take a look :-
void displayDigit(char digit, int position) {
char digitString[2] = {digit, '\0'};
matrix.displayText(digitString, position, 50, 0, PA_PRINT, PA_PRINT);
}
void loop() {
DateTime now = rtc.now();
char timeString[9];
sprintf(timeString, "%02d:%02d:%02d", now.hour(), now.minute(), now.second());
for (int i = 0; i < 8; i++) {
matrix.displayClear(); // Clear the display
for (int j = 0; j < 8; j++) {
char digitChar = timeString[j];
displayDigit(digitChar, j);
matrix.displayAnimate();
delay(100); // Adjust the delay to control the animation speed
}
}
}
Here as you can see I have also tried to manually position the string components but it didn't worked as I figured out that the positional parameter can take only three values 0, 1 and 2 which corresponds to Left , Center and Right, the string stopped displaying after reaching the far right corner.
Also Please cut me some slack as this is an older code in which I tested the positional parameter but hadn't broke the timestring using sprintf. The idea I had was to display the different components of time in different places by changing the positional parameter but it failed.
- Next UKHeliBob gave me an article which explained what zones are actually used for I always thought that zones are for controlling groups of matrices that you get from store, I mean for example the hardware type FC16_HW has four 8x8 matrices so if you are using 2 of those modules then zones would become 2. That is what I thought but how wrong I was.LOL.
Here is what I did with my new acquired knowledge of zones but failed here as well.
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 8
#define CS_PIN 10
MD_Parola matrix = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
RTC_DS1307 rtc;
unsigned long previousmillis = 0;
unsigned long interval = 3000;
int seconds = 0, minutes = 0, hours = 0;
int prevseconds = 0, prevminutes = 0, prevhours = 0;
int display_flag = 0, introDone = 0;
char hourstring[2], minutestring[2], secondstring[2];
void setup(void)
{
matrix.begin(3);
rtc.begin();
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
matrix.setZone(0, 0, 2);
matrix.setZone(1, 3, 5);
matrix.setZone(2, 6, 7);
matrix.displayZoneText(0, secondstring, PA_LEFT, 50, 100, PA_NO_EFFECT, PA_NO_EFFECT);
matrix.displayZoneText(1, minutestring, PA_CENTER, 50, 100, PA_NO_EFFECT, PA_NO_EFFECT);
matrix.displayZoneText(2, hourstring, PA_RIGHT, 50, 100, PA_NO_EFFECT, PA_NO_EFFECT);
}
void loop(void)
{
clock();
reset_zones();
}
void clock(void)
{
DateTime now = rtc.now();
hours = now.hour();
minutes = now.minute();
seconds = now.second();
sprintf(hourstring, "%d%d", (now.hour()/10), (now.hour()%10));
sprintf(minutestring, "%d%d", (now.minute()/10), (now.minute()%10));
sprintf(secondstring, "%d%d", (now.second()/10), (now.second()%10));
}
void reset_zones(void)
{
matrix.displayAnimate();
if(matrix.getZoneStatus(0))
{
if((display_flag == 0) && (seconds != prevseconds))
{
matrix.setTextEffect(0, PA_SCROLL_UP, PA_SCROLL_UP);
prevseconds = seconds;
}
else
{
matrix.setTextEffect(0, PA_NO_EFFECT, PA_NO_EFFECT);
}
matrix.displayReset(0);
}
if(matrix.getZoneStatus(1))
{
if((display_flag == 0) && (minutes != prevminutes))
{
matrix.setTextEffect(1, PA_SCROLL_UP, PA_SCROLL_UP);
prevminutes = minutes;
}
else
{
matrix.setTextEffect(1, PA_NO_EFFECT, PA_NO_EFFECT);
}
matrix.displayReset(1);
}
if(matrix.getZoneStatus(2))
{
if((display_flag == 0) && (hours != prevhours))
{
matrix.setTextEffect(2, PA_SCROLL_UP, PA_SCROLL_UP);
prevhours = hours;
}
else
{
matrix.setTextEffect(2, PA_NO_EFFECT, PA_NO_EFFECT);
}
matrix.displayReset(2);
}
}
This code just displays the seconds only once(they don't refresh) and they are flickering as well, minutes and hours are absent from the display(they are not displaying the places where they should be displayed are off). Also please tell me how to use the setzone() function, if I use this configuration then there is some space left between the 0th and 1st zone but the 2nd zone loses some place where it should display data, you can say that the 1st zone is shifted a little bit to the left (away from the data lines where arduino is connected).
You don't have to give a code I want to do everything myself (as its a birthday gift for my little brother(he loves leds) ) but please guide me on what should be done to achieve this 
I highly appreciate you guys helping me.