New beta release "DMD2" Library

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
Post Reply
angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

New beta release "DMD2" Library

Post by angusgr » Wed Apr 23, 2014 8:22 am

I've just uploaded a new Arduino library for the Dot Matrix Display modules, DMD2.

https://github.com/freetronics/DMD2

This library is not backwards compatible with the original DMD library. It's also currently a beta release, documentation is incomplete and there will probably be bugs. Please report any bugs you do find. :)

The new library comes with several example sketches that you can base new functionality on.

Changes from DMD library

The DMD2 library includes the following new features:
  • Supports Arduino Due (IDE 1.5.6 or newer), as well as AVR-based Arduinos and all Freetronics Arduino-compatible boards.
  • Adds new "SoftDMD" support, which allows the standard DMDCon expansion board connections to be used on all standard Arduino compatible models - including Arduino Mega/EtherMega, Arduino Due/EtherDue or Arduino Leonardo. No more custom wiring for Megas!
  • Integrated timer management for simpler sketches (optional, easily disabled if you want more control.)
  • Improved performance, a single DMD panel uses approximately 5% CPU overhead to update (in either SoftDMD or SPIDMD modes.)
  • New drawString() methods accept flash strings, or the Arduino String type, directly. See the "AllDrawingOperations" example.
  • New DMD_TextBox class supports automatic scrolling, and automatic print() interface for writing out numbers, variables, etc. See "Countdown" and "ScrollingAlphabet" examples.
  • New dmd.setBrightness() call allows changing DMD brightness (no more blindingly bright displays!)
  • New DMDFrame base class allows direct swapping of the DMD framebuffer, supporting double buffering operations and similar (see "GameOfLife" example.)
Not Yet Implemented
  • Test patterns
  • Marquee support
Please report any problems you find on the forums, or use the Issues feature on github.

Support for this beta DMD2 library will be slow over the next month, as I'm going to be travelling, but I'll look into any outstanding issues when I get back. If you're not keen to live dangerously then I suggest sticking with the stable DMD Library for now, until this one is no longer a beta release.

User avatar
stryker
Posts: 266
Joined: Sat Jan 14, 2012 2:44 pm

Re: New beta release "DMD2" Library

Post by stryker » Wed Apr 23, 2014 1:39 pm

Hi,

Truly appreciate your continued work on this.

Just so you know, there's an additional "*/" on line 25 of TextBox.cpp that throws an error when you try to compile any of the examples. Typical output follows:

Code: Select all

C:\Users\Geoff\Documents\Arduino\libraries\DMD2\DMD2_TextBox.cpp:25: error: expected unqualified-id before '/' token
C:\Users\Geoff\Documents\Arduino\libraries\DMD2\DMD2_TextBox.cpp:25: error: expected constructor, destructor, or type conversion before '/' token
In file included from c:/program files (x86)/arduino/hardware/tools/avr/lib/gcc/../../avr/include/inttypes.h:37,
                 from C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/Print.h:23,
                 from C:\Users\Geoff\Documents\Arduino\libraries\DMD2\/DMD2.h:28,
                 from C:\Users\Geoff\Documents\Arduino\libraries\DMD2\DMD2_TextBox.cpp:26:
c:/program files (x86)/arduino/hardware/tools/avr/lib/gcc/../../avr/include/stdint.h:159: error: 'int8_t' does not name a type
c:/program files (x86)/arduino/hardware/tools/avr/lib/gcc/../../avr/include/stdint.h:213: error: 'int8_t' does not name a type
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/WString.h:29,
                 from C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/Print.h:26,
                 from C:\Users\Geoff\Documents\Arduino\libraries\DMD2\/DMD2.h:28,
                 from C:\Users\Geoff\Documents\Arduino\libraries\DMD2\DMD2_TextBox.cpp:26:
c:/program files (x86)/arduino/hardware/tools/avr/lib/gcc/../../avr/include/avr/pgmspace.h:215: error: 'int8_t' does not name a type
In file included from C:\Users\Geoff\Documents\Arduino\libraries\DMD2\DMD2_TextBox.cpp:26:
C:\Users\Geoff\Documents\Arduino\libraries\DMD2\/DMD2.h:183: error: 'int8_t' does not name a type
C:\Users\Geoff\Documents\Arduino\libraries\DMD2\/DMD2.h: In member function 'void SPIDMD::setOtherCS(byte)':
C:\Users\Geoff\Documents\Arduino\libraries\DMD2\/DMD2.h:202: error: 'class SPIDMD' has no member named 'pin_other_cs'
Removing line 25 sorts this error.

Thanks, Geoff

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 » Wed Apr 23, 2014 11:30 pm

Oops, how embarassing! I added those comments at the last minute and didn't check for errors. Fixed now, thanks for pointing it out.

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

Re: New beta release "DMD2" Library

Post by Brissieboy » Wed Apr 30, 2014 5:27 am

angusgr,

A couple of suggestions to consider, please:

1. Allow for limited scrolling with marquees - it would be nice to be able limit both the horizontal and vertical ranges for scrolling.
Example A: Scroll within a limited width (columns) of the display by setting the start and end columns so as to leave a number of columns on the left and/or right available and untouched while scrolling only within the specified window
Example B: Scroll of a part of the display (a limited number of rows) while the remainder stay still and are not erased.

2. Allow an option for continuous scrolling such that the marquee is re-scrolled immediately (with a settable gap?) after the last character appears on the display - don't wait for the text to scroll completely off the screen before restarting.

3. If you do nothing else, PLEASE add copious comments to the code. This is open source software so many people will want to explore/modify/learn from it. Explain each and every step.
THERE IS NO SUCH THING AS TOO MANY COMMENTS!

Brissieboy

bwooce
Posts: 21
Joined: Mon May 28, 2012 11:15 am

Re: New beta release "DMD2" Library

Post by bwooce » Tue May 27, 2014 6:29 am

I've moved my scoreboard to DMD2, and it is much faster and cleaner.

The tweaks you've done to get the integrated interrupt refresh working fast are great -- everything I did on my own with DMD1 ended in a locked up display so it's great to just have it work out of the box.

The one thing I'm missing, but I am pondering how to add, is proper text updating. e.g. when a score goes down from 10 to 9, there are artefacts from the 1 and 0 left over. Drawing a box over the entire individual panel for every update is overkill and causing some flashing (on one line, maybe row 3) which is odd. I'm not sure why drawing a box of off pixels and then (on the next line) overlaying the new digits would cause that?

I did have a lot of old code that would infer if those artefacts were going to occur (e.g. 2 digits to 1 etc) but it sure would be nice for the library to work that out for me. Would that be an appropriate modification to TextBox?

Nice work.

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 27, 2014 11:54 pm

Hi everyone,

Thanks for the comments and feedback!

Brissieboy - thanks for the comments, will take them on board! Please let me know if you have any others, much appreciate your work on the DMD library to date.

bwooce - Sounds like a bug. Any chance you could please post your sketch which exhibits these display artifacts? Either on here using the "code" BBCode tag, or you can use an external site like http://pastebin.com and then post a link.

- Angus

victorhooi
Posts: 16
Joined: Thu Mar 06, 2014 4:00 pm

Re: New beta release "DMD2" Library

Post by victorhooi » Thu May 29, 2014 1:55 am

Hi,

Cool, looks very interesting - thanks Angus for releasing.

I'm currently making a world clock using daisy-chained DMDs.

Would you recommend I use DMD2 for this? Any caveats I should be aware of? Or any cool new features I can take advantage of? :)

Any word on future updates to the library, or when the docs might be out?

Thanks,
Victor

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 » Thu May 29, 2014 11:10 pm

victorhooi wrote: Would you recommend I use DMD2 for this? Any caveats I should be aware of? Or any cool new features I can take advantage of? :)
You should generally need less code to get the same effect. Also it's a lot easier if you're on a non-Uno-based platform (ie not an Eleven/EtherMega.)

I'd try with DMD2, post here if you have any problems and I/we should be able to help you out.

- Angus

moonerj2
Posts: 11
Joined: Sun Jun 08, 2014 11:44 pm

Re: New beta release "DMD2" Library

Post by moonerj2 » Thu Jun 12, 2014 8:13 am

Hi , I have a arduino mega, can i use the dmd2 lib , are there any pin changes for this to work.

the plan is to run a Race Start Controller , with currently the following
DHT > Temp > pin 22
RTC > Time > pin A6,A7
Relay > to switch 12V circuits > 23, 24,25,26
Buzzer > 6V runs ok on 5V > 27
and LCD > using LiquidCrystal(31,30,35,34,33,32) for users to change menu settings
and the DMD on the following, to display a count down, time and temp
Aref > Aref
Gnd > Gnd
pin 13 > pin 52
pin 12 > pin 50
pin 11 > pin 51
pin 10 > pin 53
pin 9 > pin 9
pin 8 > pin 8
pin 7 > pin 7
pin 6 > pin 6

everything works ok on there own , LiquidCrystal(31,30,35,34,33,32) works but the LCD library doesn't work as in the " form " demo in "examples","LCD". which demonstrates the use of menus.
# include LCD.h
Lcd.lcd

Any advice would be greatly accepted.
cheers richard

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 » Thu Jun 12, 2014 11:05 pm

moonerj2 wrote:Hi , I have a arduino mega, can i use the dmd2 lib , are there any pin changes for this to work.
No changes required, if you use the DMDCon board with the standard pins then you can use the SoftDMD class in DMD2 to talk to the display. The examples in DMD2 should all run without modification.
moonerj2 wrote: everything works ok on there own , LiquidCrystal(31,30,35,34,33,32) works but the LCD library doesn't work as in the " form " demo in "examples","LCD". which demonstrates the use of
I see you've also asked the same question in the LCD Keypad forum (please don't ask the same question in multiple places, it's confusing.) So I'll reply to you there.

Post Reply