In the Double Height Fonts Only:- All the the ( effectIn ) animations which grows horizontally including Sprites; progresses at very slow speed (almost half ) of the speed of EffectOut animations. This phenomenon is directly proportional to length of textBuffer. I am using atmega1284 controller. More than 75% SRAM is free. Just tried Example code Parola_Double_Height_V2 and changed the PA_SCROLL_LEFT effect with PA_WIPE_CURSOR.
The text array which is having 3 characters wiped out at fast speed, as the length of text increases , huge difference in effectin speed and effectout speed has been observed.
This issue has become more prominent on arduino Uno. (at that time I was thinking the issue was because of free SRAM availability) thats why I shifted to atmega1284. I have observed Some what improvement in speed of effectin speed but still it takes 4 seconds to wipe cross the length of 20(20 are in upper + 20 are in lower zone) modules if I SetSpeed to 0.
I am not an expert neither of hardware nor of software.
I am just trying this Library to make Little more wide screen. Before approaching to this length of screen I have tested all the Library on 5 modules. Everything was working seamlessly.
Hope you would bear my silly mistake if I had made. Please correct me.
Looking forward valuable help from respectable MD_Parola community .
Thanks
Insert your code here.
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#include "Font_Data.h"
// Turn debugging on and off
#define DEBUG 0
#if DEBUG
#define PRINTS(s) { Serial.print(F(s)); }
#define PRINT(s, v) { Serial.print(F(s)); Serial.print(v); }
#else
#define PRINTS(s)
#define PRINT(s, v)
#endif
// Define the main direction for scrolling double height.
// if 1, scroll left; if 0, scroll right
#define SCROLL_LEFT 1
// Hardware adaptation parameters for scrolling
bool invertUpperZone = false;
textEffect_t scrollUpper, scrollLower;
// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers may not work with your hardware and may need changing
#define HARDWARE_TYPE MD_MAX72XX::ICSTATION_HW
#define MAX_ZONES 2
#define ZONE_SIZE 20
#define MAX_DEVICES (MAX_ZONES * ZONE_SIZE)
#define ZONE_UPPER 1
#define ZONE_LOWER 0
#define PAUSE_TIME 0
#define SCROLL_SPEED 0
#define CLK_PIN 7 //SCK standard mightycore arduino pin
#define DATA_PIN 5 //MOSI
#define CS_PIN 4 //SS
// HARDWARE SPI
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
// SOFTWARE SPI
//MD_Parola P = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
char *msgL[] =
{
"Dou",
"ABC",
"abcvwxyz",
"0123456789",
"`!@,./|\\{}",
};
char *msgH; // allocated memory in setup()
void setup(void)
{
uint8_t max = 0;
#if DEBUG
Serial.begin(57600);
PRINTS("\n[Double_Height_v2]");
#endif
// set up global parameters
invertUpperZone = (HARDWARE_TYPE == MD_MAX72XX::GENERIC_HW || HARDWARE_TYPE == MD_MAX72XX::PAROLA_HW);
if (invertUpperZone)
{
#if SCROLL_LEFT // invert and scroll left
scrollUpper = PA_SCROLL_RIGHT;
scrollLower = PA_SCROLL_LEFT;
#else // invert and scroll right
scrollUpper = PA_SCROLL_LEFT;
scrollLower = PA_SCROLL_RIGHT;
#endif
}
else // not invert
{
#if SCROLL_LEFT // not invert and scroll left
scrollUpper = PA_OPENING_CURSOR;
scrollLower = PA_OPENING_CURSOR;
#else // not invert and scroll right
scrollUpper = PA_OPENING_CURSOR;
scrollLower = PA_OPENING_CURSOR;
#endif
}
// work out the size of buffer required
for (uint8_t i = 0; i<ARRAY_SIZE(msgL); i++)
if (strlen(msgL[i]) > max) max = strlen(msgL[i]);
msgH = (char *)malloc(sizeof(char)*(max + 2));
// initialise the LED display
P.begin(MAX_ZONES);
// Set up zones for 2 halves of the display
P.setZone(ZONE_LOWER, 0, ZONE_SIZE - 1);
P.setZone(ZONE_UPPER, ZONE_SIZE, MAX_DEVICES-1);
P.setFont(BigFont);
P.setCharSpacing(P.getCharSpacing() * 2); // double height --> double spacing
if (invertUpperZone)
{
P.setZoneEffect(ZONE_UPPER, true, PA_FLIP_UD);
P.setZoneEffect(ZONE_UPPER, true, PA_FLIP_LR);
}
PRINT("\nFLIP_UD=", P.getZoneEffect(ZONE_UPPER, PA_FLIP_UD));
PRINT("\nFLIP_LR=", P.getZoneEffect(ZONE_UPPER, PA_FLIP_LR));
PRINT("\nSCROLL_LEFT=", SCROLL_LEFT);
}
void createHString(char *pH, char *pL)
{
for (; *pL != '\0'; pL++)
*pH++ = *pL | 0x80; // offset character
*pH = '\0'; // terminate the string
}
void loop(void)
{
static uint8_t cycle = 0;
P.displayAnimate();
if (P.getZoneStatus(ZONE_LOWER) && P.getZoneStatus(ZONE_UPPER))
{
PRINT("\n", cycle);
PRINT(": ", msgL[cycle]);
// set up the string
createHString(msgH, msgL[cycle]);
P.displayClear();
if (invertUpperZone)
{
P.displayZoneText(ZONE_UPPER, msgH, PA_CENTER, SCROLL_SPEED, PAUSE_TIME, scrollUpper, scrollLower);
P.displayZoneText(ZONE_LOWER, msgL[cycle], PA_CENTER, SCROLL_SPEED, PAUSE_TIME, scrollUpper, scrollLower);
}
else
{
P.displayZoneText(ZONE_LOWER, msgL[cycle], PA_LEFT, SCROLL_SPEED, PAUSE_TIME, scrollLower, scrollLower);
P.displayZoneText(ZONE_UPPER, msgH, PA_LEFT, SCROLL_SPEED, PAUSE_TIME, scrollUpper, scrollUpper);
}
// prepare for next pass
cycle = (cycle + 1) % ARRAY_SIZE(msgL);
// synchronize the start and run the display
P.synchZoneStart();
}
}