Go Down

Topic: LED matrix display - MD_Parola, MD_MAX72xx and MD_MAXPanel (Read 537078 times) previous topic - next topic

borzov161

Marco
library 3.0.2  example "Parola_Double_Height_v1_Russian",  module FC-16.
 
"Create double height displays using 2 custom fonts and 2 zones",   // Everything's in order. ok
  "Zone 0 for lower half",                     //  Everything's in order. ok                                       
  "Zone 1 for upper half",                    //  Everything's in order. ok
  "BIG",                                              //  Everything's in order. ok
  "ABCDEFGHIJKLMNOPQRSTUVWXYZ",                    //  Everything's in order. ok
  "abcdefghijklmnopqrstuvwxyz",                    //  Everything's in order. ok
  "0123456789",                                            //  Everything's in order. ok
  "`!@#$%^&*()_+-={};:'\"<>?,./|\\{}",           //  Everything's in order. ok
  "АБВГДЕЖЗКЛМНОПРСТФУХЦЧШЩЪЫЬЭЮЯ",   // черный экран// 0 second
  "абвгдежзлмнопрстуфхцчшщъыьэюя"               // черный экран// 0 second
and immediately new cycle
"Create double height displays using 2 custom fonts and 2 zones",   // Everything's in order. ok
  "Zone 0 for lower half",                     //  Everything's in order. ok                                       
  "Zone 1 for upper half",                    //  Everything's in order. ok
and so on
......

marco_c

I don't think the display will show correctly with these double byte russian characters in your string (look at the UFT-8 Display example).
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

borzov161

Marco
library 3.0.2  example "Parola_UFT-8_Display",  module FC-16.
In one height I was able to print Russian letters.
Added 2 lines and it worked!
Нere is a code snippet and a link to the entire sketch example with Russian letters. Maybe someone will come in handy.
...............
 switch (cPrev)  // Conversion depending on preceding UTF8-character
    {
    case 0xC2: c = ascii;  break;
    case 0xC3: c = ascii | 0xC0;  break;
    case 0x82: if (ascii==0xAC) c = 0x80; // Euro symbol special case
    case 0xD0: c = ascii | 0x100;  break;  // 208  1 bit of the Cyrillic alphabet//
    case 0xD1: c = ascii | 0x100;  break;  // 209  1 bit of the Cyrillic alphabet//
    }
    cPrev = ascii;   // save last char
...................
https://yadi.sk/d/jhMS_hzi70vuug

borzov161

Marco
library 3.0.2  example "Parola_UFT-8_Display",  module FC-16
function
// ****** UTF8-Decoder: convert UTF8-string to extended ASCII *******
You made a variable "char" - That's cool!
Help.
The Cyrillic text is printed correctly only the first time.
re-printing of the Cyrillic text does not occur.
Printing in two heights does not occur at all.
 void utf8Аscii(char* s) --not help.
the above example I posted

marco_c

Please post your sketch in this forum so that we can see what you have done.

If it works the first time then you somehow have a logic error in your code that prevents it from working the second time. Please recheck your code and make sure that it does what you think it should be doing.

Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

borzov161

#1475
Feb 23, 2019, 11:32 am Last Edit: Feb 23, 2019, 04:46 pm by borzov161
Feb 21, 2019, 09:22 pm
Marco
library 3.0.2  example "Parola_UFT-8_Display",  module FC-16

The liif convectorUFT-8  do in "void setup()" - that all works fine! - sketch 1
The liif convectorUFT-8  do in "void loop()" -  ne is visible only 1 time -sketch 2

Code: [Select]
#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 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);

const char* msg[] = {
  "ENGL",//English
  "АБГД",//Russia
  "ЭЮЯ", //Russia
  "1234" //
   };

void setup(void) {  
  P.begin();
  P.setFont(ExtASCII);
  for (byte i=0; i < 4;i++ ) {
       char* RUS = msg[i];
       utf8Ascii(RUS); // In place conversion UTF-8 string to Extended ASCII
       }
}
void loop(void){
static unsigned long taimer =0; static uint8_t i=0;
  if(millis()-taimer > 2000) {
    taimer=millis();
    i<3 ? i++ : i=0;
    P.print(msg[i]);
    }
 }

//--------------conversion-----------
uint8_t utf8Ascii(uint8_t ascii)
{
 static uint8_t cPrev;
  uint8_t c = '\0';
  if (ascii < 0x7f )   // Standard ASCII-set 0..0x7F, no conversion
  {
    cPrev = '\0';
    c = ascii;
  }
  else
  {
    switch (cPrev)  // Conversion depending on preceding UTF8-character
    {
    case 194: c = ascii; break;
    case 195: c = ascii | 0xC0;  break;
    case 130: if (ascii==0xAC) c = 0x80; // Euro symbol special case
    case 208: c = ascii | 0x100;  break; // russia 1 byte alphabet
    case 209: c = ascii | 0x100;  break; // russia 1 byte alphabet
    }
    cPrev = ascii;   // save last char
  }
  return(c);
}
void utf8Ascii(char* s)
// In place conversion UTF-8 string to Extended ASCII
// The extended ASCII string is always shorter.
{
  uint8_t c, k = 0;
  char *cp = s;
  while (*s != '\0')
  {
    c = utf8Ascii(*s++);
    if (c != '\0')
      *cp++ = c;
  }
  *cp = '\0';   // terminate the new string
}


sketch 2
Code: [Select]
#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 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);

const char* msg[] = {
  "ENGL",//English
  "АБГД",//Russia
  "ЭЮЯ", //Russia
  "1234" //
   };

void setup(void) {  
  P.begin();
  P.setFont(ExtASCII);
}
void loop(void){
static unsigned long taimer =0; static uint8_t i=0;
  if(millis()-taimer > 2000) {
    taimer=millis();
    i<3 ? i++ : i=0;
    char* RUS = msg[i];
    utf8Ascii(RUS);
    P.print(msg[i]);
    }
 }

//--------------conversion-----------
uint8_t utf8Ascii(uint8_t ascii)
{
 static uint8_t cPrev;
  uint8_t c = '\0';
  if (ascii < 0x7f )   // Standard ASCII-set 0..0x7F, no conversion
  {
    cPrev = '\0';
    c = ascii;
  }
  else
  {
    switch (cPrev)  // Conversion depending on preceding UTF8-character
    {
    case 194: c = ascii; break;
    case 195: c = ascii | 0xC0;  break;
    case 130: if (ascii==0xAC) c = 0x80; // Euro symbol special case
    case 208: c = ascii | 0x100;  break; // russia 1 byte alphabet
    case 209: c = ascii | 0x100;  break; // russia 1 byte alphabet
    }
    cPrev = ascii;   // save last char
  }
  return(c);
}
void utf8Ascii(char* s)
// In place conversion UTF-8 string to Extended ASCII
// The extended ASCII string is always shorter.
{
  uint8_t c, k = 0;
  char *cp = s;
  while (*s != '\0')
  {
    c = utf8Ascii(*s++);
    if (c != '\0')
      *cp++ = c;
  }
  *cp = '\0';   // terminate the new string
}



borzov161

Marco.
another question on another subject.
Modules max7219 fc16 -sensitive to external electrical interference.
For example, if you turn on the table lamp next to max7219, the max7219 will be lit by chaotic squares.
how to initialize max7219 in " void loop ()"?  ( by timer).
if you use the command "P. begin();" the sketch hangs.

Any other options?

marco_c

Check to make sure your power supply is stable.

If you want to create a dynamic shutdown/startup, then you will need to create the object using new and eliminate it using delete. At the moment you have one static object and that does not give you any options.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

noelvd

Marco,
thanks a lot for the great work on the libraries !

I'm using MD_Parola with a 8x32 matrix, and a Wemos. From a webpage, I can control the display.

Now I've started to build the 32x40 matrix (5 x 4-in-1 matrix), with the MD_Panel library.
With the intensity down to 1 (leds are still very visible in daylight), I am able to run this directly from an Arduino, with power via USB (PC or Powerpack). I had a few issue with the last 2 modules in the display (not enough current), but that was fixed by connecting +5V to the last module as well. Works like a charm now :)
I have also started to create different animations.

On the ToDo :
 - Build/buy a frame
 - Replace Arduino with Wemos. If that works, I can make a web-interface for the display.
 - Attache a DHT22 (Temperature and humidity)
 - Write more animations

Jerware

I'm currently using MD_Parola to great effect but I sometimes want to draw full bitmap graphics directly to the screen. Unfortunately it appears I can't access the underlying setColumn() or setPoint() MD_MAX72XX functions. Do I need to jettison the cool MD_Parola features and just build on top of MD_MAX72XX?

EDIT:

I found the article Parola A to A -- Mixing Text and Graphics (https://arduinoplusplus.wordpress.com/2018/03/29/parola-a-to-z-mixing-text-and-graphics/), which suggests it's possible to instantiate my own MD_MAX72XX in addition to MD_Parola with the aid of some helper functions. I think I was hoping to simply pass a bitmap byte array (same format as sprites?) to displayText() and it would just do its thing, but this works.

marco_c

@noelvd: Good to hear you are enjoying yourself.

@Jerware: Use the getGraphicObject() method to get a pointer to the MD_MAX72xx object shared by MD_Parola().
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Jerware

@Jerware: Use the getGraphicObject() method to get a pointer to the MD_MAX72xx object shared by MD_Parola().
Oh, I see. Thank you! I suppose I'll just displaySuspend(true), do my getGraphicObject()->setColumn() business, and then displaySuspend(false). That's exactly what I wanted to do!

marco_c

... or just don't call animate() and Parola stops running.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Hi,

I'm using a MAX7219 based 16x16 leds matrix with the last version of parola, hw type is ICStation (I bought it too long ago, and can't find it at ebay anymore), the four led matrix are mounted like this with the interconnect cable betweein matrix 2 and 3

Code: [Select]

+---+---+
| 4 = 3 |
+---/---+
| 2 = 1 | <=DIN (using hw based SPI)
+---+---+


I'm using a 8266 wemos D1 mini.

Parola looks to be working ok, I'm able to print text and even plot some individual points. Nothing fancy but works ok.

However, the brightness control is only working at matrix 1, matrix 2, 3 and 4 are stuck at brighness 6 or 7 (that's what it look to my eyes anyway). Any idea what could be causing this ? Could it be a hardware problem or limitation ?
I tried to control it as a whole and individually as 4 zones but got no difference at all.
--
You never learn anything by doing it right.

marco_c

Dimming is done using SPI messages (like any other operation on the matrix). I can't explain why this would not work but the other functionality (that also used SPI messages) works ok.

I would look at hardware setup factors - power supply, comms lines, etc, but really don't know and have not seen this before.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Go Up