New beta release "DMD2" Library

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
RuralGeek
Posts: 10
Joined: Tue Aug 27, 2013 3:57 am

Re: New beta release "DMD2" Library

Post by RuralGeek » Wed Apr 20, 2016 11:14 pm

Curious to know why the size of font changes how text is displayed?
If you choose a large font - once it reaches the edge of the display the first characters 'scoll' off and the new characters come on the end.
With the small font that spreads across two lines - it basically fills both lines and then stops. Any reason why the small fonts can't be scrolled like the larger fonts?

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: New beta release "DMD2" Library

Post by angusgr » Tue May 03, 2016 6:12 am

RuralGeek, are you able to post your sketch code for me to take a look at?

Angus

RuralGeek
Posts: 10
Joined: Tue Aug 27, 2013 3:57 am

Re: New beta release "DMD2" Library

Post by RuralGeek » Tue May 03, 2016 6:40 am

Fairly sure it was the SAMPLES -> DMD2 -> ScrollingAlphabet

Will try it in the morning to confirm this.

RuralGeek
Posts: 10
Joined: Tue Aug 27, 2013 3:57 am

Re: New beta release "DMD2" Library

Post by RuralGeek » Thu May 05, 2016 3:55 am

Can confirm from the built -in sample, if you use this font: const uint8_t *FONT = Arial14;
The display simply keeps scrolling the text continuously.

With this font: const uint8_t *FONT = SystemFont5x7;
It fills the display and then stops...

Will investigate the code a bit more in depth over the weekend.

plito
Posts: 16
Joined: Sat Sep 23, 2017 8:24 pm

Re: New beta release "DMD2" Library

Post by plito » Tue Oct 31, 2017 3:17 pm

Why can´t I use a different font with DMD2 ? I modified a standar font but I had to use the same name ( Arial_Black ) because it doesn´t let me use a font with another name on the compilation. Sorry for my english.

plito
Posts: 16
Joined: Sat Sep 23, 2017 8:24 pm

Re: New beta release "DMD2" Library

Post by plito » Wed Nov 01, 2017 8:59 pm

Is there any instruction to replace "stepMarquee" of DMD library ? I´ve tried with "marqueeScrollX" but the scrolling is too slow using 4 P10 panels.
Thanks

felipedream
Posts: 1
Joined: Wed Nov 29, 2017 4:23 pm

Re: New beta release "DMD2" Library

Post by felipedream » Wed Nov 29, 2017 5:08 pm

Hi, How do I connect a 5x2 panel to arduino? with this dmd2 library, since the other one does not work for me at all.
Code:
http://www.shinedesign.cl/p10.html
Config:
Image

chello
Posts: 1
Joined: Wed Mar 07, 2018 2:36 am

Re: New beta release "DMD2" Library

Post by chello » Wed Mar 07, 2018 2:40 am

ESP8266 swapbuffer support?

Brissieboy
Posts: 109
Joined: Fri Sep 20, 2013 7:25 am

Re: New beta release "DMD2" Library

Post by Brissieboy » Tue May 01, 2018 6:47 am

Not sure how much support the DMD2 library is getting these days.
Seems to have stagnated.

Brissieboy
Posts: 109
Joined: Fri Sep 20, 2013 7:25 am

Re: New beta release "DMD2" Library

Post by Brissieboy » Tue May 08, 2018 4:50 am

The DMD2 library (DMD2-0.0.3) has the same problem as the original DMD library where is cannot handle a variable width font space character - it always gives it an 'n' width regardless of the font definition.
I have modified the charWidth() method in the library to correct this problem. If you want to define your own width for the space character, you can replace the existing method in the DMD_Text.cpp file in the DMD2 directory under the Arduino libraries directory with the following:

Code: Select all

//Find the width of a character
//int DMDFrame::charWidth(const char letter, const uint8_t *font)
int DMDFrame::charWidth(char letter, const uint8_t *font)
{
  struct FontHeader header;
  memcpy_P(&header, (void*)this->font, sizeof(FontHeader));

  if(!font)
    font = this->font;

  if((uint8_t)letter < header.firstChar || (uint8_t)letter >= (header.firstChar + header.charCount)) {
    return 0;
  }

  if(header.size == 0) {
    // zero length is flag indicating fixed width font (array does not contain width data entries)
    return header.fixedWidth;
  } else {
  // variable width font, read width data for character
    if((letter == ' ') && (pgm_read_byte(this->font + sizeof(FontHeader)) == 0)) {
      // if the letter is a space and it is not defined in the font
	  // (ie the width value is zero) then give it the same width as an 'n'
	  letter = 'n';
    }
  }
  return pgm_read_byte(this->font + sizeof(FontHeader) + letter - header.firstChar);
}
This now correctly handles all cases:- fixed width; variable width without space definition; variable width with space definition.

Post Reply