Using P10 panels with dmd2 libary

Hi,

I've shearch in forum, but couldn't find any related answer.

I want to control P10 led display with Arduino Uno via DMD2 libary. It is no problem with small fonts.

But, I want character can be seen from far away. Let's say I want characters' heigh is more then one panel as in below illustration.

I've written bigger fonts wit GLCD_FontCreator. Up untill 24pixel heigh nothing happens. It is shown in one panel. When I cross the 24 pixel, let''s say 32, I'm taking error message:
Compilation error: 'Verdana32' was not declared in this scope

Is there a way?

My code is:

#include <Verdana24.h>
#include <Verdana26.h>
#include <Verdana28.h>
#include <Verdana30.h>
#include <Verdana32.h>
#include <Verdana36.h>
#include <Verdana72.h>

#include <SPI.h>
#include <DMDTUR.h>

#define DISPLAY_WIDTH 2
#define DISPLAY_HEIGHT 2

const uint8_t *Font = Verdana24;

int i=0;
int j=0;
int k=0;

SoftDMD dmd(DISPLAY_WIDTH,DISPLAY_HEIGHT);
//BoxTr box(dmd);

void setup() {
  dmd.begin();
  dmd.setBrightness(20);
  dmd.selectFont(Font);   // Set the font size scale
  dmd.clearScreen();
}

void loop() {
  dmd.clearScreen();
  dmd.selectFont(Font);
  for (int i=64; i>0; i--){
    delay(75);
    dmd.drawString(i, -2, "Test");
    }
  for (int j=64; j>0; j--){
    delay(75);
    dmd.drawString(j, 14, "Item");
    }
  //dmd.updateDisplay();
  delay(1000);
  dmd.clearScreen();
  dmd.selectFont(Font);
  for (int k=0; k<5; k++){
    delay(100);
    dmd.drawString(4, -2, "F5");
    dmd.drawString(4, 14, "TB512");
    delay(1000);
    dmd.clearScreen();
    delay(100);
    } 
}

Each font takes up space in memory. The size of the font array grows roughly in proportion to the square of the height of the font, i.e. a 32 pixel font takes up 16 times more memory than an 8 pixel font.
Uno has quite a bit of memory, and you are loading a few large fonts. I think that your program simply does not have enough memory.

Possible solutions :
Try to load only those fonts that are used in the code. For example, your program uses only font Verdana24 - so the lines are included with other fonts can be removed.
Another (a better) option is to use a board with more memory, such as arduino mega, esp32, rp2040 or stm32. If you want to change the controller type - I can suggest you try my library.

1 Like

If you comment-out this line:

#include <Verdana32.h>

Do you then receive this error?

Compilation error: 'Verdana36' was not declared in this scope

That might indicate size of memory... in that case, I would make a note of all the characters you use and edit the libraries to remove unused characters.

This is what number zero looks like:

0x80, 0xF0, 0xFC, 0x7E, 0x0E, 0x0F, 0x07, 0x07, 0x07, 0x07, 0x0F, 0x1E,
0x7E, 0xFC, 0xF0, 0x80, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x0F, 0x3F, 0x7E,
0x70, 0xF0, 0xE0, 0xE0, 0xE0, 0xE0, 0xF0, 0x70, 0x7E, 0x3F, 0x0F, 0x01, //48 '0'
1 Like

Hmm, thanks for all informations.

I've heard about stm32 before but haven't work with them. It seems there are several different stms. Could you suggest one?

Also I need to make serial comminication with computer via python. Can I do that with stm?

[quote="xfpd, post:3, topic:1153924, full:true"]
If you comment-out this line:

#include <Verdana32.h>

Do you then receive this error?

Compilation error: 'Verdana36' was not declared in this scope

I'm not sure, I'll try.

I can tell you that, if I include all libaries but use only Verdana24 there is no error message. Error only occures when I use font bigger then 26pixel. Such as:

const uint8_t *Font = Verdana32;

Most arduino projects with stm32 family controllers were created on the so-called "bluepill board" - stm32F103C8T6

You may be more comfortable using Raspberry Pico RP2040-based boards as it is better supported by Arduino IDE.

1 Like

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