Coder Social home page Coder Social logo

majicdesigns / md_parola Goto Github PK

View Code? Open in Web Editor NEW
419.0 38.0 133.0 10.51 MB

Library for modular scrolling LED matrix text displays

License: GNU Lesser General Public License v2.1

C++ 98.46% C 1.54%
arduino library led-matrix led scrolling matrices parola arduino-library max7219 max7221

md_parola's People

Contributors

arduino12 avatar kolyshkin avatar majicdesigns avatar makelion avatar njh avatar per1234 avatar phoenixphoebus avatar suryanisaac avatar uniqp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

md_parola's Issues

avr/io.h ESP8266

Hi downloaded via Library Manager but get error when compiling the ESP8266 avr/io.h

Example trying to compile Parola_Scrolling_ESP8266

Whats the best way to work round the issue ?

Any advice appreciated

ESP8266: error: redeclaration of 'CLOSING'

Hi,

when I included Parola and this library into my project where I need ofcourse WiFi connectivity the compile fails. With error: redeclaration of 'CLOSING'.
Without Wifi it works ok (while most of the out effects don't work, but ok for me).

...\arduino-1.6.9\portable\packages\esp8266\hardware\esp8266\2.3.0-rc2\libraries\ESP8266WiFi\src/ESP8266WiFi.h:28:0,

from ...\arduino-1.6.9\portable\sketchbook\MySketch\ESP8266\My\MAX7219_WiFiMqtt_Display\MAX7219_WiFiMqtt_Display.ino:3:

...\arduino-1.6.9\portable\packages\esp8266\hardware\esp8266\2.3.0-rc2\libraries\ESP8266WiFi\src/include/wl_definitions.h:81:17: error: redeclaration of 'CLOSING'

CLOSING = 8,
^

In file included from ...\arduino-1.6.9\portable\sketchbook\MySketch\ESP8266\My\MAX7219_WiFiMqtt_Display\MAX7219_WiFiMqtt_Display.ino:1:0:

...\arduino-1.6.9\portable\sketchbook\libraries\Parola\src/MD_Parola.h:305:3: note: previous declaration 'textEffect_t CLOSING'

CLOSING, ///< Appear and disappear from the ends of the display, towards the middle

Is that something that can be fixed? Or do you have a suggestion for a workaround?

BR

PlatformIO

I'm trying to get MD_Parola to work with PlatformIO. http://platformio.org/lib/show/1389/MD_Parola
The library is available via the library manager. But the required MD_MAX72xx library is not available as far as I can see. And because of that the MD_Parola library is not working.

Any idea why it's not available as a package? Or even included in the Parola package.

Hope anyone can point me in the right direction on how to solve this. Thanks.

Possible SPI conflict on ESP32/8266?

I'm using the latest version of the MD_Parola (3.1.1) and MD_MAX3.1.0 using an ESP32 (multiple boards) and Arduino Studio 1.8.10.
I'm using a 4 devices MAX7219 LED Matrix (tried different pieces).
I'm using the default SPI port for the MAX7219 (as there is no option to pass another SPI port).
The LED matrix works fine.
Now I wanted to read a text from an NFC Tag using the popular PN532 RFID Reader which is also connected to the SPI port with another CS Pin.

And now I have the following problem:
Both work seperately but not together. The PN532 Reader is detected but as soon as the text scrolling is used in the loop (using exactly the simple scoll example from MD_Parola), the reader does no longer read/find NFC Tags, if I comment out the loop part below the reader works.
if (P.displayAnimate())
{
if (newMessageAvailable)
{
strcpy(curMessage, newMessage);
newMessageAvailable = false;
}
P.displayReset();
}

I don't get an error, it does just does not find NFC tags.

I also tried the following:
I used another SPI port (VSPI) with the GPIO Pins 12,13,14,15 which is actually isolated from the default port (HSPI) on 18,19,23,5 it does not work either only if I comment out the P.DisplayAnimate(). So I just assuming that there is a SPI conflict on certain devices.
If I use another RFID Reader (RC522) it seem to work but then I have other problems.

Maybe somebody has an idea what collison might be event if different SPI ports are used.

Can't define MD_Parola by Pointer

Hi,
I want to make the instance defined by dynamic settings, so I try to use a pointer. But nothing will be shown on the screen.
I make two simple examples to demonstrate the problem.

Example 1 Normal Way - Working

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

#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4

#define CLK_PIN   27
#define DATA_PIN  25
#define CS_PIN    32

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

void setup(void)
{
  SPI.begin(CLK_PIN, 0, DATA_PIN, 0);
  P.begin();
  P.displayText("Hello", PA_CENTER, 100, 500, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
}

void loop(void)
{
  P.displayAnimate();
}

Example 2 Pointer Way - Display Nothing

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

#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4

#define CLK_PIN   27
#define DATA_PIN  25
#define CS_PIN    32

MD_Parola* P;

void setup(void)
{
  P = new MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

  SPI.begin(CLK_PIN, 0, DATA_PIN, 0);
  P->begin();
  P->displayText("Hello", PA_CENTER, 100, 500, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
}

void loop(void)
{
  P->displayAnimate();
}

I'm not a good coder.
Hope someone could tell me why Pointer won't work and How to modify it to make pointer work?

how to use zones and normal at the same time?

hi
esp 8622, md_parola 3.0.2
i have 12 display line and 3 columns, 36 matrix display.
can i use 2 for big font (from exampe) and one normal?
i try to display some text in 2'th zone, but something wrong..

0 zone and 1 zone is fordouble height, 2 for normal.
#define MAX_DEVICES 36
#define MAX_ZONES 3
#define MAX_DEVICES (MAX_ZONES * ZONE_SIZE)
#define ZONE_SIZE 12
#define ZONE_UPPER 0
#define ZONE_LOWER 1
#define ZONE_FREE 2

P.setZone(ZONE_UPPER,0, ZONE_SIZE - 1 );
P.setZone(ZONE_LOWER,ZONE_SIZE,(ZONE_SIZE2)-1 );
P.setZone(ZONE_FREE, (ZONE_SIZE
2), MAX_DEVICES);

in loop ::
P.displayClear();
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);
P.displayZoneText(ZONE_FREE,"test", PA_CENTER, SCROLL_SPEED, PAUSE_TIME, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
cycle = (cycle + 1) % ARRAY_SIZE(msgL);
P.synchZoneStart();

}

and "test" take big font..can i use normal font for this?
I do not see any example for use gig font and small at the same time.

add new fonts?
P.displayClear();
P.setFont(BigFont);
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);
P.setFont(font);
P.displayZoneText(ZONE_FREE,"test", PA_CENTER, SCROLL_SPEED, PAUSE_TIME, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
cycle = (cycle + 1) % ARRAY_SIZE(msgL);
P.synchZoneStart();

Indent from a character of zero length / Отступ от символа нулевой длинны

When using characters of zero length, a 1 pixel gap is inserted after the character with zero length. I do this to use the Russian font without transcoding, for this I created a font where the most significant bit is zero length (208 and 209), works well, but it turns out that there is a gap of 2 pixels between the characters. It does not have any logic. Is it possible to fix this?
Sketch and font here: https://github.com/immortalserg/MD_Parola_fonts

При использовании символов нулевой длинны после символа с нулевой длинной вставляется разрыв в 1 пиксель. Я это делаю для использования русского шрифта без перекодировки, для этого создал шрифт где старший бит нулевой длинны (208 и 209), работает хорошо но получается, что между символами разрыв в 2 пикселя. Это не имеет ни какой логики. Возможно ли это исправить?
Скетч и шрифт тут: https://github.com/immortalserg/MD_Parola_fonts

Compilation error

Example Parola_Fonts
MD_MAX72xx.h:288:33: error: section attribute not allowed for 'MD_MAX72XX::fontType_t'

typedef const PROGMEM uint8_t fontType_t;

Static text printing to a zone using displayZoneText?

Hello,

I am using Parola on a simple configuration: 8 devices and two Parola zones.

What I want to do is have static text in one zone without any animation. The other zone will have scrolling text.

I can't seem to figure out how to do this. With a single zone (no zone) setup I could simply to Parola.print("XXX"), but this doesn't work reliably if you have more than on zone.

Using "displayZoneText()" forces me to provide an animation and a duration.

Is there any way to simply plonk text into the middle, left or right of a zone without a duration and exist effect. Therefore having text show indefinitely?

Thank you again for such a great library.

PA_NO_EFFECT as incoming effect causes outgoing effect to be ignored

Subject of the issue

When specifying PA_NO_EFFECT as the incoming text effect for setTextEffect(), with an effect as the outgoing effect, the outgoing effect animation is ignored.

Your Environment

Library Version: all versions
Hardware model/type: all versions

Issue description

Using the code
P.setTextEffect(zone, PA_NO_EFFECT, PA_SCROLL_UP);
does not scroll up text that is already being displayed.

Workaround is to specify
P.setTextEffect(zone, PA_PRINT, PA_SCROLL_UP);
which visually looks the same but behaves as expected with the text scrolling off the display.

P.synchZoneStart() not working properly

hello,
i made a display with 16x2 (2rows and 16columns).Total 32 8x8 matrices.
i wrote a code for double height display demo...Total 32 devices taken as two zones(bottom zone and Top Zone),,,in that P.synchZoneStart(); is not working properly...When data is scrolling the two zones are not in synchonization....the bottom zone is slight faster than top zone....

please give me suggestions,
thanq,
Sankar.

displayZoneText()/displayText() won't show any effect but PA_NO_EFFECT

Hi,
I am trying to get my text scrolling by using displayZoneText() and/or displayText(), but whenever I try to set an effect different from static printing I won't see any text at all. Indeed, I have tried some other effects in addition to scrolling, but they won't show either.
Here a piece of code for the displayZoneText() try. The commented static text will show just nicely.
I tried displayText() without setting any zone as well...but did not work..

I would really appreciate some tips!
Thanks in advance

Code Demonstrating the Issue

#include <stdio.h>
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
//#include "Parola_Fonts_data.h"
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 8
#define CLK_PIN   13
#define DATA_PIN  11
#define CS_PIN    10
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
void setup()
{
  P.begin(2);
  P.setZone(0,0,3);
  P.setZone(1,4,7);
  P.displayZoneText(0,"smome text", PA_CENTER, 5, 1,PA_SCROLL_LEFT, PA_SCROLL_LEFT );
  //P.displayZoneText(0, "Press Start!", PA_CENTER, 0, 0, PA_PRINT, PA_NO_EFFECT);
  //P.displayZoneText(1, "Press Start!", PA_CENTER, 0, 0, PA_PRINT, PA_NO_EFFECT);
  P.displayAnimate();
}

Add to Arduino IDE library manager

It would be great to add this library to the Arduino IDE library manager.
That would allow users to quickly and easily install it directly from the Arduino IDE GUI in just seconds.
It keeps the less technical users from doing things like installing it incorrectly and allows them to easily updated it when updates come out.

It isn't difficult to do, (you have to get the Arduino team to add it - but that is a one time thing)
Then after that, when you have a new release all you have to do is create a tag and the library manager will discover the new release in about an hour.
https://github.com/arduino/Arduino/wiki/Library-Manager-FAQ

BTW, it would also be helpful to add some installation instructions to the readme.

error: invalid conversion from 'char' to 'const char*' [-fpermissive]

IMPORTANT

Before submitting this issue
[Y] Have you tried using the latest version of the library?
[Y] Have you checked this has not already been submitted and/or resolved?
[ ] If you are requesting help a better choice may be the Arduino forum

Subject of the issue

error: invalid conversion from 'char' to 'const char*' [-fpermissive]

Your Environment

In code

Steps to Reproduce

dunno

Expected Behaviour

Correct building

Actual Behaviour

Explain what happens instead. Provide log messages if relevant.

Code Demonstrating the Issue

Arduino:1.8.10 (Windows 10), Tarjeta:"LOLIN(WEMOS) D1 R2 & mini, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600"

C:\Users\PENH\AppData\Local\Temp\arduino_modified_sketch_667308\Parola_Sprites_Simple.ino: In function 'void setup()':

Parola_Sprites_Simple:65:30: error: invalid conversion from 'char' to 'const char*' [-fpermissive]

   P.displayText(msg[curString], PA_CENTER, P.getSpeed(), PAUSE_TIME, PA_SPRITE, PA_SPRITE);

                              ^

In file included from C:\Users\PENH\AppData\Local\Temp\arduino_modified_sketch_667308\Parola_Sprites_Simple.ino:8:0:

C:\Users\PENH\OneDrive\Documentos\Arduino\libraries\MD_Parola-master\src/MD_Parola.h:1344:15: error:   initializing argument 1 of 'void MD_Parola::displayText(const char*, textPosition_t, uint16_t, uint16_t, textEffect_t, textEffect_t)' [-fpermissive]

   inline void displayText(const char *pText, textPosition_t align, uint16_t speed, uint16_t pause, textEffect_t effectIn, textEffect_t effectOut = PA_NO_EFFECT)

               ^

Se encontraron varias bibliotecas para "MD_Parola.h"
Usado: C:\Users\PENH\OneDrive\Documentos\Arduino\libraries\MD_Parola-master
Se encontraron varias bibliotecas para "MD_MAX72xx.h"
Usado: C:\Users\PENH\OneDrive\Documentos\Arduino\libraries\MD_MAX72XX-master
Se encontraron varias bibliotecas para "SPI.h"
Usado: C:\Users\PENH\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.2\libraries\SPI
exit status 1
invalid conversion from 'char' to 'const char*' [-fpermissive]

Este informe podría contener más información con
"Mostrar salida detallada durante la compilación"
opción habilitada en Archivo -> Preferencias.

It says 'Setup' Cannot find a way to setup.

Respected Sir/Madam,
I've uploaded this code to Arduino Mega, no problem in uploading the code and also changed the pin number, bluetooth module number correctly. While it starts up, the Dot Matrix MAX7219 displays only 'Setup' I cannot find a way to setup the bluetooth. I've read the code and it said to write 'AT+' and something like 'NAME\0\0' or '\r\n' I cannot understand how to setup this bluetooth. Please help me do this setup thing. And I am using HC-06 module.
Thank you.

P.begin() appears to cause continual reboots on Wemos D1 Mini ESP8266 after MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

IMPORTANT

Before submitting this issue

  • Have you tried using the latest version of the library?
  • Have you checked this has not already been submitted and/or resolved?
  • If you are requesting help a better choice may be the Arduino forum

Subject of the issue

~Building an internet "always right" clock project.
~Experienced weird board issues with resets, not uploading etc.
~Troubleshoot for a couple of days and have found that board resets continually if I attempt to begin an instance of MD_Parola using P.begin() after MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
~If I comment out just that line, the sketch works as expected

Your Environment

Library Version: 3.0.2
Arduino IDE version: 1.8.5
Hardware model/type: Wemos D1 Mini v3 (almost certainly a Chinese clone)
**OS and Version: **Microsoft Windows [Version 10.0.17134.648]

Steps to Reproduce

Uncomment line 36 in the code below being //P.begin();

Expected Behaviour

The sketch should run. The sketch runs with line 36 commented out.

Actual Behaviour

Continual resetting of board every ~8 seconds
e.g. Serial output as follows.
boot mode 3 means "software reset"
https://arduino-esp8266.readthedocs.io/en/latest/boards.html#rst-cause

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v951aeffa
~ld

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v951aeffa
~ld

Code Demonstrating the Issue

#include <SPI.h>
#include <ezTime.h>
#include <ESP8266WiFi.h>          // Replace with WiFi.h for ESP32
#include <ESP8266WebServer.h>     // Replace with WebServer.h for ESP32
#include <AutoConnect.h>
#include <MD_Parola.h>
//#include <MD_MAX72xx.h>

#define HARDWARE_TYPE MD_MAX72XX::ICSTATION_HW
#define MAX_DEVICES 4
//#define CLK_PIN   5
//#define DATA_PIN  6
#define CS_PIN    7

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

ESP8266WebServer Server;          // Replace with WebServer for ESP32
AutoConnect Portal(Server);

void rootPage() {
  char content[] = "Hello, world ... browse to http://<ip addres>/_ac to configure AP, SSID, password etc. settings";
  Server.send(200, "text/plain", content);
}

void setup() {

  // Open serial communications and wait for port to open:
  Serial.begin(115200);

  // wait for serial port to connect. Needed for native USB port only
  //while (!Serial) {
  //  ;
  //}

  //P.begin();
  //P.print("Hello!");

  // Set ezTime debug level as required [https://github.com/ropg/ezTime#setdebug]
  setDebug(DEBUG);

  //Beging Debug Output
  Serial.println(">>");
  Serial.println();
  Serial.println();
  Serial.println();
  Serial.println("----Debug Begins--------------------------------------------");
  Serial.println();

  // Enable Autoconnect portal and if successful, output Ip to debug
  Server.on("/", rootPage);
  if (Portal.begin()) {
    Serial.println("WiFi connected: " + WiFi.localIP().toString());
  }

  // We're now online

  // Wait for ezTime to get its time synchronized and wait 5 seconds
  waitForSync();
  delay(5000);

  // Create a timezone called myTZ
  Timezone myTZ;

  // Output UTC
  Serial.println();
  Serial.println("<ezTime> UTC: " + UTC.dateTime());
  Serial.println();

  //Set myTZ's location and outpit the result
  myTZ.setLocation(F("Africa/Johannesburg"));
  Serial.print(F("<ezTime> myTZ: "));
  Serial.println(myTZ.dateTime());
  Serial.println(myTZ.getTimezoneName());
  Serial.println(myTZ.getOlson());

  //Set NTP update frequency in seconds
  setInterval(60); //[https://github.com/ropg/ezTime#setserver-and-setinterval]
}

void loop() {
  //P.print(millis()/1000);
  //Handle the Autoconnect client
  Portal.handleClient();
  
  //Handle the ezTmine events //[https://github.com/ropg/ezTime#events]
  events();
}

dependancy on MD_UISwitch

While compiling Parola_Test_TG.ino this error occured
/Documents/Arduino/libraries/MD_Parola/examples/Parola_Test_TG/Parola_Test_TG.ino:21:25: fatal error: MD_UISwitch.h: No such file or directory
compilation terminated.

It appears that this library is dependant on 'MD_UISwitch'
It can be fixed by installing MD_UISwitch using the library manager.

line missing in Parola_Print_Test in Arduino IDE

Hi,

If you load the Parola_Print_Test example from the Arduino IDE the following line seems to be missing:

const uint16_t WAIT_TIME = 1000;

If you paste it in under the defines it then compiles without errors

Thanks
Stuart

double zone dht22

Dear congratulations for your library, as the title says I need to show temperature and humidity in double zone but I can't find something that can help me, you could be so kind as to guide me please.

This is the code I use to test my sensor and it works correctly

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

#define HARDWARE_TYPE MD_MAX72XX::ICSTATION_HW
#define MAX_DEVICES 4
#define CLK_PIN   13
#define DATA_PIN  11
#define CS_PIN    10

// Hardware SPI connection
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

#include <DHT.h>
#include <DHT_U.h>
#define DHTPIN 2     // Digital pin connected to the DHT sensor
#define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321

DHT dht(DHTPIN, DHTTYPE);

void setup() {
  pinMode(3, OUTPUT);    // sets the digital pin 13 as output
  digitalWrite(3, HIGH); // sets the digital pin 13 on
  P.begin();
  dht.begin();
}

void loop() {
  
  // Wait a few seconds between measurements.
  delay(2000);

  float h = dht.readTemperature();

   P.setTextAlignment(PA_CENTER);
   P.print(h,0);


}

and this is the code that I tried and that I would like to use to show the sensor temperature

// Demonstrates one way to create a double height display using Parola.
//
// Largely based on code shared by arduino.cc forum user Arek00, 26 Sep 2015.
// Video of running display can be seen at https://www.youtube.com/watch?v=7nPCIMVUo5g
//
// The upper and lower portions are managed as 2 zones 'stacked' on top of each other
// so that the module numbers are in the sequence shown below:
//
// * Modules (like FC-16) that can fit over each other with no gap
//  n n-1 n-2 ... n/2+1   <- this direction top row
//  n/2 ... 3  2  1  0    <- this direction bottom row
//
// * Modules (like Generic and Parola) that cannot fit over each other with no gap
//  n/2+1 ... n-2 n-1 n   -> this direction top row
//  n/2 ... 3  2  1  0    <- this direction bottom row
//
// Each font displays letters for either top or bottom half of the message. Sending the
// same string to both zones creates the complete message
// on the display.
//
// MD_MAX72XX library can be found at https://github.com/MajicDesigns/MD_MAX72XX
//


#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#include "Font_Data.h"
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>

#define DHTPIN 2
#define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321
DHT dht(DHTPIN, DHTTYPE);
uint32_t delayMS;


#define DEBUG 0

// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define HARDWARE_TYPE MD_MAX72XX::ICSTATION_HW
#define MAX_ZONES 2
#define ZONE_SIZE 4
#define MAX_DEVICES (MAX_ZONES * ZONE_SIZE)
#define SCROLL_SPEED  30

#define ZONE_UPPER  1
#define ZONE_LOWER  0

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

// 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);

// Hardware adaptation parameters for scrolling
bool invertUpperZone = false;

#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
char *msg[] =
{
   "TEMP 25C",
   "HUM 40%",
};

void setup(void)
{
  invertUpperZone = (HARDWARE_TYPE == MD_MAX72XX::GENERIC_HW || HARDWARE_TYPE == MD_MAX72XX::PAROLA_HW);

#if DEBUG
  Serial.begin(57600);

  Serial.println("[Double Height demo start]");
  
#endif

  // initialise the LED display
  P.begin(MAX_ZONES);

  // Set up zones for 2 halves of the display
  // Each zone gets a different font, making up the top
  // and bottom half of each letter
  P.setZone(ZONE_LOWER, 0, ZONE_SIZE - 1);
  P.setFont(ZONE_LOWER, BigFontLower);

  P.setZone(ZONE_UPPER, ZONE_SIZE, MAX_DEVICES-1);
  P.setFont(ZONE_UPPER, BigFontUpper);
  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);
  }

  pinMode(3, OUTPUT);    // sets the digital pin 13 as output
  digitalWrite(3, HIGH); // sets the digital pin 13 on
  dht.begin();
  sensor_t sensor;
  delayMS = sensor.min_delay / 2000;
}

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

float h = dht.readHumidity();

  // Run the animation and then check if BOTH zones have
  // completed. The animations are not the same length due
  // to upper/lower effects being displayed differently.
  P.displayAnimate();

  if (P.getZoneStatus(ZONE_LOWER) && P.getZoneStatus(ZONE_UPPER))
  {
#if DEBUG
    Serial.println(cycle);
#endif

    switch (cycle)
    {
    default:
      P.setFont(ZONE_LOWER, BigFontLower);
      P.setFont(ZONE_UPPER, BigFontUpper);
      if (invertUpperZone)
      {
        P.displayZoneText(ZONE_LOWER, msg[cycle], PA_LEFT, SCROLL_SPEED, 0, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
        P.displayZoneText(ZONE_UPPER, msg[cycle], PA_LEFT, SCROLL_SPEED, 0, PA_SCROLL_RIGHT, PA_SCROLL_RIGHT);
      }
      else
      {
        P.displayZoneText(ZONE_LOWER, msg[cycle], PA_RIGHT, SCROLL_SPEED, 0, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
        P.displayZoneText(ZONE_UPPER, msg[cycle], PA_LEFT, SCROLL_SPEED, 0, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
      }
      break;


    }

    // prepare for next pass
    cycle = (cycle + 1) % ARRAY_SIZE(msg);

    // synchronise the start
    P.displayClear();
    P.synchZoneStart();
    delay(delayMS);
  }
}

Upper Portion of doublefont Stuck while scrolling .

IMPORTANT

Before submitting this issue
[ ] Have you tried using the latest version of the library?
[ ] Have you checked this has not already been submitted and/or resolved?
[ ] If you are requesting help a better choice may be the Arduino forum

Subject of the issue

Describe your issue here.

Your Environment

Library Version: MD_Parola-3.1.1
Arduino IDE version: 1.8.9
Hardware model/type: ICSTATION_HW
OS and Version:Windows10

.

I have used example code of MD_Parola Library : Parola_Double_Height_v2

Expected Behaviour

In double Height font examples:
Message is Scrolling from Right to left, when scrolling is about to reach an end , the upper portion of double font stuck in 8 LED's modules while lower portion keep moving and finished flawlessly.
Problem

Thanks

Finalize of Last issues

Hi MajicDesigns, thanks for the consideration. The error message I got was something like "Can't find MD_Parola_H library", but as I said I'm completely new to this stuff and there's something I might be doing completely wrong. Didn't even knew there was a Daft Punk example in your libraries! Any chance you can give a step by step note on how to correctly compile that program on my Arduino?

Thanks again!

led matrix buzzy noise

Hello,
I am using MAX7219 dot led matrix panel (16x64 combination).

everything working fine, but it has some buzzing noise.
is there any solution?

In Double Height Fonts effectIn speed is too slow even if Speed is set to Zero ( to make run at fastest) .

Subject of the issue

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

Library Version: MD_Parola-3.1.1
Arduino IDE version: 1.8.9
Hardware model/type: ICSTATION_HW
OS and Version:Windows10

Code Demonstrating the Issue

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();
  }
}

MD_Parola.h

in MD_Parola.h

  // Font character handling data and methods
  charDef_t *_userChars;  // the root of the list of user defined characters
  uint8_t   _cBuf[15];    // buffer for loading character font
  uint8_t   _charSpacing; // spacing in columns between characters
  uint8_t   _charCols;    // number of columns for this character
  int16_t   _countCols;   // count of number of columns already shown
  MD_MAX72XX::fontType_t  *_fontDef;  // font for this zone

cBuf [15] seems a bit risky. Would not it be better to ask the font which is its maximum width ???

In my case I use 22 pixels wide fonts ... and strange things happened before identifying this array of uint8_t .....

uint8_t MD_MAX72XX::getMaxFontWidth(void)
{
	uint8_t max = 0, charWidth;
	uint16_t	offset = 1;

	if (_fontIndex == NULL)
		return 0;

	PRINTS("\nFinding max font width");
	for (int16_t i=0; i<FONT_INDEX_SIZE; i++)
	{
		charWidth = pgm_read_byte(_fontData+offset);

		PRINT("\nASCII '", i);
		PRINT("' offset ", offset);
		PRINT("' max width ", max);

		if (charWidth > max)
			charWidth = max;
		offset += charWidth;
		offset++;
	}
	return max;
}

setIntensity for multi-zone configuration only changes Intensity for the first module.

Hello! Firstly, fantastic work with your library. How can I donate?

I have a small problem. I tried your Parola_Zone_Dynamic demo, which I got to work without issue. However, I wanted to set the intensity of the LED matrix to 0 (minimum), and I have discovered that it will only set the intensity of the FIRST module to 0. Not the entire display as expected.

My code is as follows (essentially a small adjustment to the Parola_Zone_Dynamic example to work with ESP8266)

// Program to demonstrate using dynamic (changing) zones with the MD_Parola library
//
// Zones are changed by 2 modules for each iteration and a simple string
// is displayed in the zone.
//
// MD_MAX72XX library can be found at https://github.com/MajicDesigns/MD_MAX72XX
//

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

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

#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

// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 8
#define CS_PIN    D8
#define MAX_ZONES   2
#define STEP_SIZE   2


// 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

// Global variables
char	*pc[MAX_ZONES] =
{
  "Zone0",
  "Zone1",
};

void setZones(void)
{
  static uint8_t zoneBoundary = 0;

  PRINTS("\nZones");
  if (zoneBoundary != 0)
  {
    P.setZone(0, 0, zoneBoundary-1);
    PRINT(" [0] 0:", zoneBoundary - 1);
    P.displayZoneText(0, pc[0], PA_CENTER, SPEED_TIME, PAUSE_TIME, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
    P.displayReset(0);
  }

  if (zoneBoundary != MAX_DEVICES)
  {
    P.setZone(1, zoneBoundary, MAX_DEVICES-1);
    PRINT(" [1] ", zoneBoundary);
    PRINT(":", MAX_DEVICES-1);
    P.displayZoneText(1, pc[1], PA_CENTER, SPEED_TIME, PAUSE_TIME, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
    P.displayReset(1);
  }

  // Set new zone sizes
  zoneBoundary += STEP_SIZE;
  if (zoneBoundary > MAX_DEVICES) zoneBoundary = 0;

  P.synchZoneStart();
}

void setup(void)
{
#if DEBUG
  Serial.begin(74880);
#endif
  PRINTS("[Parola Dynamic Zone Demo]");

  P.begin(MAX_ZONES);
  //P.setInvert(1, true); // sets invert for zone 1 only OK
  P.setInvert(false);   // sets invert for all zones OK
  P.setIntensity(0); //sets intensity for first phyiscal 8x8 LED matrix only - BUG

  setZones();
}

void loop(void)
{
  if (P.displayAnimate()) // animates and returns true when an animation is completed
  {
    boolean bAllDone = true;

    for (uint8_t i=0; i<MAX_ZONES && bAllDone; i++)
    {
      bAllDone = bAllDone && P.getZoneStatus(i);
    }

    if (bAllDone) setZones();
  }
}

Custom font causes compiler error (when used with aREST)

I'm trying to combine MD_Parola with aREST but it's throwing a compiler error at me. This error is only generated when I enable a custom font. It has to do with the PROGMEM identifier but my arduino knowledge it too limited to understand/fix the issue here. It could very well be that the issue is not caused MD_Parola but by the aREST lib in that case I apologise for posting it here.

This is the full error I'm getting.

src/main.cpp:23:32: error: fontSysFixedSingle causes a section type conflict with __c
MD_MAX72XX::fontType_t PROGMEM fontSysFixedSingle[] = {};
^
In file included from /Users/marcfon/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/Arduino.h:243:0,
from src/main.cpp:1:
/Users/marcfon/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/pgmspace.h:21:51: note: '__c' was declared he
re
#define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
^
/Users/marcfon/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/WString.h:38:76: note: in definition of macro
 'FPSTR'
#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
^
/Users/marcfon/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/WString.h:39:34: note: in expansion of macro 
'PSTR'
#define F(string_literal) (FPSTR(PSTR(string_literal)))
^
lib/aREST_ID429/aREST.h:1456:15: note: in expansion of macro 'F'
addToBuffer(F("\", \"connected\": true}\r\n"));
^

The code below isn't doing anything useful but it's the minimum needed to reproduce the compiler error.

#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <aREST.h>

// matrix display
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

//------- aREST Settings ------

aREST rest = aREST();

//------- Matrix Settings ------
#define MAX_DEVICES 4
#define CLK_PIN   D5
#define DATA_PIN  D7
#define CS_PIN    D8

// Hardware SPI connection
MD_Parola P = MD_Parola(CS_PIN, MAX_DEVICES);

MD_MAX72XX::fontType_t PROGMEM fontSysFixedSingle[] = {};

void setup() {
  Serial.begin(115200);
  Serial.println("aRestTest");

  P.begin();
  P.setFont(fontSysFixedSingle);
}

void loop() {
    // Do something useful here
}

Wrong Week's Day

Greetings Marco!
I'm using your 'Parola_Zone_TimeMsg' sketch;
I loaded a sketch 'DS3231_Serial_Easy' on the DS3231 RTC to set the time, and when I record the sketch, shows the correct time and date on the display, but Day of the Week is wrong, for example, today (I recorded the sketch) "Sunday, April 21, 2019" is showing "Saturday, April 21, 2019". Would you have any tips for me?
NOTE: On Serial Monitor shows correct: Sunday, April 21, 2019
Thank you very much

A way to get a pointer to the Hardware library object

Hi,
I need to shutdown the display when i put the ESP8266 in deepsleep.
But there is no way to retrieve the _D object.
Would it be the good way to add in MD_Parola.h:
MD_MAX72XX* getMAX() { return &_D;}

and to put in my code:
P.getMAX()->control(MD_MAX72XX::SHUTDOWN, true)

Regards

Wipe does not work for one segment (zone)

Hi Marco,

Testing your great library I found out that wipe (PA_WIPE) effect does not work for one segment display nor for one segment zone area.
Environment: ESP32 + MAX7219 + USE_ICSTATION_HW

How to reproduce:
Change the example Parola_Animation_Catalog example like this
#define MAX_DEVICES 1
in the sCatalog table shorten the psz from "WIPE" to "W" e.g. { PA_WIPE, "W", 5, 1 },

The program hangs and does not leave the animation, stays there for ever.
I haven't yet troubleshoot this, juts wanted to let you know :)

...anyway great job!
P.

Built error on ESP8266

Version 2.7.3 does not built, see below, Version 2.6.6 did without any problem

K:\Arduino\libraries\MD_Parola\src\MD_PZone.cpp: In member function 'void MD_PZone::setSpriteData(uint8_t*, uint8_t, uint8_t, uint8_t*, uint8_t, uint8_t)':

K:\Arduino\libraries\MD_Parola\src\MD_PZone.cpp:98:17: error: invalid conversion from 'uint8_t* {aka unsigned char*}' to 'char*' [-fpermissive]

_spriteInData = inData;

K:\Arduino\libraries\MD_Parola\src\MD_PZone.cpp:101:18: error: invalid conversion from 'uint8_t* {aka unsigned char*}' to 'char*' [-fpermissive]

_spriteOutData = outData;

Parola_Double_Height_Test.ino

Hi,

I took a lot of time to understand why the various effects of the demonstration do not work and in the end I found out something was wrong here:

memcpy_P(&ci, catalog + (idxCat * sizeof(catalogItem_t)), sizeof(catalogItem_t));

I'm using 3 zones of 8 modules so

typedef struct catalogItem_t
{
bool fPause;
uint8_t zFX[MAX_ZONES];
};

is 1 byte for bool and 3 bytes for zone FX.

and in fact sizeof(catalogItem_t) return 4.

At first loop idxCat is 0 so catalog + ( 0 * 4) so

memcpy_P(&ci, catalog ), 4);

catalog , if I remember correctly, is 0x110A.
At second loop I would expect:

memcpy_P(&ci,catalog + (1 * 4),4) --->>> memcpy_P(&ci,0x110A + (1 * 4),4) that becomes memcpy_P(&ci,0x110E,4) instead it becomes memcpy_P(&ci,0x111A,4) and each loop the flashram pointer increase of 0x10 instead of 0x04.

Obviously for first loops maybe you are lucky to read an effect that should be done 4 times later but in the later ones you read some of the code in flash (maybe the characters).

I have solved in that way:

    Serial.println("");
    Serial.print("memcpy_P() flash address = ");
    Serial.println( (unsigned long)catalog + idxCat * sizeof(catalogItem_t),HEX);
    Serial.print("memcpy_P() flash address = ");
    Serial.println( (unsigned long)(catalog + (idxCat * sizeof(catalogItem_t))),HEX);

    // copy the next catalog item into RAM
    memcpy_P(&ci, (const void *)((unsigned long)catalog + (idxCat * sizeof(catalogItem_t))),   sizeof(catalogItem_t));

serial debug result :

[Double_Height_Test]
Allocating memory: 7
Changed speed to 44
C0: M0: 876
memcpy_P() flash address = 116E
memcpy_P() flash address = 116E

Changed speed to 24
C0: M1: LuiZa
memcpy_P() flash address = 116E
memcpy_P() flash address = 116E

Changed speed to 19
C1: M0: 876
memcpy_P() flash address = 1172
memcpy_P() flash address = 117E ????

C1: M1: LuiZa
memcpy_P() flash address = 1172
memcpy_P() flash address = 117E ????

C2: M0: 876
memcpy_P() flash address = 1176
memcpy_P() flash address = 118E ????

C2: M1: LuiZa
memcpy_P() flash address = 1176
memcpy_P() flash address = 118E

C3: M0: 876
memcpy_P() flash address = 117A
memcpy_P() flash address = 119E

C3: M1: LuiZa
memcpy_P() flash address = 117A
memcpy_P() flash address = 119E

C4: M0: 876
memcpy_P() flash address = 117E
memcpy_P() flash address = 11AE

Strange Behaviour

Ciao Marco,

I have assembled a display of 3 zones of 8 displays and adapted the demos Parola_Double_Height_Test.ino and Parola_Bluetooth_Control.ino.
Apart from the previous problems that you have already fixed, another one I had noticed but attributed to a power supply problem.
Now I've found that if I turn off the DEBUG option, the display stops at startup by displaying meaningless characters but always equal to each turn on.
Thinking he had missed something I commented on all PRINTX, PRINT, #define PRINT.. , etc. The program compiles correctly and always behaves the same way, meaningless caracters.
I added in setup() Serial.begin(57600);
No change in behavior.
I added an additional Serial.println("");
Miracle, the display works properly.

At this point I do not understand why this happens, I suspected the interrupts not enabled, I added interrupts(); in setup() instead of Serial.begin and Serial.print but it does not work anyway.
It seems that Serial.print initiates something that libraries do not do ....

Arduino MEGA 2560 , Arduino ide 1.6.19

Can you precize documentation

Hi,

I'm working on a Daft Punk Thomas helmet and I'm trying to run your code on a 8x40 LEds matrix using an Arduino Uno and 5 MAX7221 chips. I'd like to execute your code to display text on my matrix but I'm a complete newbie and it won't stop failing to compile with Arduino Software (1.8.3).
Could you help me or specify this in your documentation.

Thanks for your time.

Detect end of string

How i can detect the end of a string scrolling ? I.E. to detect when i can change the display string ?

Parola UTF8 disappear

after trying also this library to understand usage i try first with demo codes:
the example Parola_UTF-8_Display is working if i compile "AS IS"
BUT if i set DEBUG on line 33 to 1 to see in serial whats happening
the display see only Ascii standard in the first part of the code:
"abcABC"
" "
"50€/kg"
"Espaol"
"30m/s"
"Franais"
"20s/C"
after that
"128 €"
"129 "
"130 ,"
and so on...
if i reput DEBUG back to 0 the code did not work either! the only way to test the demo is to compile the code without touching it. t is possible?

big fonts justified

Hello.
Is it possible to adjust text using big fonts different way as left, center, right?
E.g. some pixels of left or right?

Half animation for static informationen

Nice, really nice project!
I wonder, how i can use a start animation (e.g. slide to left) but then should the text should stop.

I would like to have an incoming text with a nice animation. But afterwards the Text should be stay focused. And this text did have also updates.
Any chance?

Regards,
Fi

MQTT disconnects while displayText

The MQTT connection drops while using PubSub and animation using P.displayText. PubSub and MD_Parola don't play well with each other? Using a ESP8266.

...Scrolling between Time,Weekday & Date with P.print

IMPORTANT

Before submitting this issue
[ Y ] Have you tried using the latest version of the library?
[ Y ] Have you checked this has not already been submitted and/or resolved?
[ ? ] If you are requesting help a better choice may be the Arduino forum

Subject of the issue

..im trying to scroll a fuction P.print text but the library only worked on array

Your Environment

Library Version: =latest
Arduino IDE version: = 1.8.9
Hardware model/type: = FC16*2 + ( esp8266) { D1 Mini/Lolin/Nodemcu/D1r1/D1r2 }
OS and Version: =XP

Steps to Reproduce

...check my code below if its workable

Expected Behaviour

...Smooth inScrollFx/etcFx-Pause-outScrollFx/etcFx with speed control in-between Time ,Weekday and Date

Actual Behaviour

currently..no animation..just P.print buffer in nested loop counted function call

Code Demonstrating the Issue


// SIMPLE_12H_NTP_LEDMATRIX_v6.1 via WIFIMANAGER Developed by Sroto&Gargees (OpenSourced)
// http://srotogargees.business.site/
// ** Version 6.1 Bugfix **
// Portability  ( connect to any authorised available wifi via a webinterface )
// Secure,Connect to esp.AP with pw,open browser address 192.168.4.1,scanAP(SSID)+ keyin pw with internet connection

#include <FS.h>                     // Included in Arduino IDE / esp8266 setup ..google it
#include <ESP8266WiFi.h>            // http://arduino.esp8266.com/stable/package_esp8266com_index.json
#include <DNSServer.h>              // Included on esp8266 platform setup
#include <ESP8266WebServer.h>       // Included on esp8266 platform setup
#include <WiFiManager.h>            // https://github.com/tzapu/WiFiManager
#include <MD_Parola.h>              // https://github.com/MajicDesigns/MD_Parola
#include <MD_MAX72xx.h>             // https://github.com/MajicDesigns/MD_MAX72XX
#include <SPI.h>                    // Included in Arduino IDE 

const uint16_t SEC_1 = 1000;  

#define HARDWARE_TYPE MD_MAX72XX::FC16_HW

#define MAX_DEVICES 8
#define DATA_PIN  13
#define CS_PIN    15
#define CLK_PIN   14

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

const char* ntpServer = "pool.ntp.org";
const long  gmtOffset_sec = 28800;       // My,SG=+8(UTC=GMT=TIMEZONE) *60*60
const int   daylightOffset_sec = 0;

char buffer[80];

void setup()
{
  Serial.begin(115200);
  Serial.println();
  WiFiManager wifiManager;

  IPAddress _ip = IPAddress(10, 0, 1, 78);
  IPAddress _gw = IPAddress(10, 0, 1, 1);
  IPAddress _sn = IPAddress(255, 255, 255, 0);
  
  if (!wifiManager.autoConnect("autoConnect","password")) // scan wifi on smartphone..etc...Open browser 192.168.4.1
  {
    Serial.println("failed, reset reconnect");
    delay(3000);
    ESP.reset();
    delay(5000);
  }
  Serial.println("connected...");
  Serial.println("local ip");
  P.begin();
  P.setIntensity(0);
  P.setTextAlignment(PA_CENTER);
  Serial.println(WiFi.localIP());
  while (WiFi.status() != WL_CONNECTED) {delay(500);}
  P.write("Get NTP");
  delay(SEC_1); 
  configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
  unsigned timeout = 5000;
  unsigned start = millis();
  while (!time(nullptr))
  {
    delay(1000);
  }
  delay(1000);
  WiFi.mode(WIFI_STA);
}

void printLocalTime()
{
  time_t rawtime;
  struct tm * timeinfo;
  time (&rawtime);
  timeinfo = localtime (&rawtime);
  strftime (buffer,80,"%I:%M:%S %p",timeinfo); 
  P.print(buffer);
  delay(SEC_1); 
}

void printDayOnly()
{
  time_t rawtime;
  struct tm * timeinfo;
  time (&rawtime);
  timeinfo = localtime (&rawtime);
  strftime (buffer,80,"%A",timeinfo);
  P.print(buffer);
  delay(SEC_1); 
}

void printDateOnly()
{
  time_t rawtime;
  struct tm * timeinfo;
  time (&rawtime);
  timeinfo = localtime (&rawtime);
  strftime (buffer,80,"%d.%m.%Y",timeinfo);
  P.print(buffer);
  delay(SEC_1); 
}

void loop()
{
   for (int Ti = 0; Ti < 60; Ti++)        // until 60 counts * 1 sec delay = 60sec
      {printLocalTime();}                 // Display centered 12h Clock, Minute with Second updates & AM/PM status after +-predefined Timezone 
      for (int Dy = 0; Dy < 3; Dy++)      // the next each 1 sec until 3 count = 3sec 
      {printDayOnly();}                   // Display full Day name centered ,update Day name if changed inbetween these 3sec
      for (int Dt = 0; Dt < 3; Dt++)      // the next each 1 sec until 3 count = 3 sec 
      {printDateOnly();}    
}

Errors compiling for ESP8266

Good morning,
I got errors while compiling the sprite-demo for an ESP8266:

const uint8_t F_ROCKET = 2;
const uint8_t W_ROCKET = 11;
static const uint8_t rocket[F_ROCKET * W_ROCKET] PROGMEM = {
  0x18, 0x24, 0x42, 0x81, 0x99, 0x18, 0x99, 0x18, 0xa5, 0x5a, 0x81,
  0x18, 0x24, 0x42, 0x81, 0x18, 0x99, 0x18, 0x99, 0x24, 0x42, 0x99,
};

...

parola.setSpriteData(rocket, W_ROCKET, F_ROCKET, rocket, W_ROCKET, F_ROCKET);

error: invalid conversion from 'const uint8_t* {aka const unsigned char*}' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
 parola.setSpriteData(rocket, W_ROCKET, F_ROCKET, rocket, W_ROCKET, F_ROCKET);

Does anybody has a solution for that? Everything else is running perfect.

double height v2, esp8266, MD_MAX72XX::FC16_HW

IMPORTANT

Before submitting this issue
[ ] Have you tried using the latest version of the library?
[ ] Have you checked this has not already been submitted and/or resolved?
[ ] If you are requesting help a better choice may be the Arduino forum

Subject of the issue

Video of display output:
https://photos.app.goo.gl/hEUUkNbbnLs1WqCY8

FC16_HW is working with https://github.com/MajicDesigns/MD_Parola/tree/master/examples/Parola_Scrolling_ESP8266

// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers are for ESO8266 hardware SPI and will probably not
// work with your hardware and may need to be adapted
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 24
#define CLK_PIN D3 // or SCK
#define DATA_PIN D2 // or MOSI
#define CS_PIN D1 // or 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);

Your Environment

Library Version: 3.1.1
Arduino IDE version: 1.8.8
Hardware model/type: esp8266 nodemcu clone v3
OS and Version: Ubuntu 18.04.2 LTS

Steps to Reproduce

Explain how to reproduce this issue. Please provide working code below to demonstrate the issue.

https://github.com/MajicDesigns/MD_Parola/blob/master/examples/Parola_Double_Height_v2/Parola_Double_Height_v2.ino

Line 50 is unchanged, but I have ...

#define MAX_ZONES 2
#define ZONE_SIZE 3

Is 3 a large enough zone size, or do I need one more board (8x8 pixel, x4 max7219) ?

Seems fast enough software spi is not the issue (however, here's the wiring too)

#define CLK_PIN D3 // or SCK
#define DATA_PIN D2 // or MOSI
#define CS_PIN D1 // or 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);

Expected Behavior

Explain what should happen.

Actual Behavior

Explain what happens instead. Provide log messages if relevant.

Code Demonstrating the Issue

Insert your code here.

'class MD_Parola' has no member named 'getIntensity'

Hi,
the following statement within arduino code
uint8_t scrollIntensity = P.getIntensity();
ends up in the error message see title.

Strange, usage of
uint16_t scrollSpeed = P.getSpeed();
causes no problems, the usage of P.getCharSpacing() is working, too.

Checked up MD.Parola.h and found in class definition...
`
/**

  • Get the zone brightness.
  • Get the intensity (brightness) of the display.
  • \return The intensity setting.
    */
    inline uint8_t getIntensity() { return _intensity; }`

right below method getCharSpacing....

Used #include and #define

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

#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4 // Number of 8x8 modules linked together
#define CLK_PIN 13 // or SCK
#define DATA_PIN 14 // or MOSI
#define CS_PIN 12 // or SS

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

Library too big for Adafruit Feather 32u4

I need to reduce the size of either MD_Parola or the MAX_72XX libarary by 1372 bytes. Is there a previous version that is smaller? Is there another way to make it just a little bit smaller ?

thanks.

Crash on ESP8266 using parola_zone_mesg example

Crash on ESP8266 (wemos d1 mini) using parola_zone_mesg example

I have a crash on the example for effects
// PA_RANDOM,
// PA_SLICE,

all I changed is

#define HARDWARE_TYPE MD_MAX72XX::ICSTATION_HW
#define CLK_PIN D8 // or SCK
#define DATA_PIN D7 // or MOSI
#define CS_PIN D5 // or SS

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

I am using 8 devices.

Your Environment

Library Version:MD_Parola and MD_MAX72XX at version 3.0.2
Arduino IDE version: 1.8.5
Hardware model/type:
OS and Version:MacOS

Steps to Reproduce

Using example provided crashes for two values of effect.
Commenting the two effect gives no crash.

Expected Behaviour

no crash

Actual Behaviour

Explain what happens instead. Provide log messages if relevant.

Code Demonstrating the Issue

Insert your code here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.