Parola scrolling text

Can someone PLEASE have a look at this and guide me as to why it doesn't work :frowning:


#include <MD_Parola.h>
#include <MD_MAX72xx.h>

#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 12
#define NUM_ZONES 5
#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 10

MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

struct animations {
  textEffect_t anim_in;   // Animation type
  textEffect_t anim_out;  // Animation type
  const char* textOut;    // Text to display
  uint16_t speed;         // Animation   speed (multiplier for library default)
  uint16_t pause;         // pause   (multiplier for library default)
  textPosition_t just;
};


animations animList[] = {
  { PA_SCROLL_LEFT, PA_SCROLL_UP_RIGHT, "Test 1", 1, 6, PA_LEFT },
  { PA_RANDOM, PA_RANDOM, "Test 2", 1, 8, PA_LEFT },
  { PA_SCROLL_LEFT, PA_SCROLL_UP_RIGHT, "Test 3", 1, 6, PA_LEFT },
  { PA_SCROLL_LEFT, PA_SCROLL_LEFT, "Test 4", 2, 0, PA_LEFT },
};


void setup() {
  P.begin(NUM_ZONES);
  P.setZone(0, 0, 3);
  P.setZone(1, 4, 5);
  P.setZone(2, 6, 7);
  P.setZone(3, 8, 11);
  P.setZone(4, 0, 11);

  P.setIntensity(2);

  for (uint8_t i = 0; i < ARRAY_SIZE(animList); i++) {
    animList[i].speed *= P.getSpeed();
    animList[i].pause *= 500;
  }
}


void loop() {
  static uint8_t i = 0;  // text effect index

  if (P.displayAnimate())  //   animates and returns true when an animation is completed
  {
    if (i == ARRAY_SIZE(animList)) i = 0;  // reset loop index

    P.displayZoneText(4, animList[i].textOut, animList[i].just, animList[i].speed,
                      animList[i].pause, animList[i].anim_in, animList[i].anim_out);
    delay(1000);
    i++;  // then set up for next   text effect
  }
}

@Glen_Lewis

Morning Glen

Just one important line right at the end of the function in loop()

P.displayReset();

void loop() {
  static uint8_t i = 0;  // text effect index

  if (P.displayAnimate())  //   animates and returns true when an animation is completed
  {
    if (i == ARRAY_SIZE(animList)) i = 0;  // reset loop index

    P.displayZoneText(4, animList[i].textOut, animList[i].just, animList[i].speed,
                      animList[i].pause, animList[i].anim_in, animList[i].anim_out);
    delay(1000);
    i++;  // then set up for next   text effect
    P.displayReset();
  }
}

I changed this line :

//#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW

and added @indev2's recommendation at the end of loop().
P.displayReset();

See simulate: P_Display - Wokwi ESP32, STM32, Arduino Simulator

#include <MD_Parola.h>
#include <MD_MAX72xx.h>

//#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW
#define MAX_DEVICES 12
#define NUM_ZONES 5
#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 10

MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

struct animations {
  textEffect_t anim_in;   // Animation type
  textEffect_t anim_out;  // Animation type
  const char* textOut;    // Text to display
  uint16_t speed;         // Animation   speed (multiplier for library default)
  uint16_t pause;         // pause   (multiplier for library default)
  textPosition_t just;
};

animations animList[] = {
  { PA_SCROLL_LEFT, PA_SCROLL_UP_RIGHT, "Test 1", 1, 6, PA_LEFT },
  { PA_RANDOM, PA_RANDOM, "Test 2", 1, 8, PA_LEFT },
  { PA_SCROLL_LEFT, PA_SCROLL_UP_RIGHT, "Test 3", 1, 6, PA_LEFT },
  { PA_SCROLL_LEFT, PA_SCROLL_LEFT, "Test 4", 2, 0, PA_LEFT },
};
//-------------------------------------------------------------
void setup() {
  P.begin(NUM_ZONES);
  P.setZone(0, 0, 3);
  P.setZone(1, 4, 5);
  P.setZone(2, 6, 7);
  P.setZone(3, 8, 11);
  P.setZone(4, 0, 11);
  P.setIntensity(2);
  for (uint8_t i = 0; i < ARRAY_SIZE(animList); i++) {
    animList[i].speed *= P.getSpeed();
    animList[i].pause *= 500;
  }
}
//-------------------------------------------------------------
void loop() {
  static uint8_t i = 0;  // text effect index
  if (P.displayAnimate())  //   animates and returns true when an animation is completed
  {
    if (i == ARRAY_SIZE(animList)) i = 0;  // reset loop index
    P.displayZoneText(4, animList[i].textOut, animList[i].just, animList[i].speed,
                      animList[i].pause, animList[i].anim_in, animList[i].anim_out);
    delay(100);
    i++;  // then set up for next   text effect
    P.displayReset();
  }
}

Thanks indev2 and ruilviana
your input is fantastic and it seams to work great :slight_smile:
Thanks again
Glen

Good afternoon and Thanks indev2
I do have another little problem with this project but i want to try to sort it out myself first (try!)
If i have troubles with it do you mind if i contact you later?

Hi Glen

No that won't be a problem. Pleased to help if I can :slightly_smiling_face:

thanks again
I'm sure i will need help :slight_smile:

I hope I can help you again.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.