Page 1 of 3

Modified DMD library

Posted: Tue Jan 10, 2012 3:34 am
by debenham
I just bought a DMD and was playing around with the included library.
It was very nice but I thought I could add a few features ;)
The main change is replacing the drawCharacter_* functions with a generic drawChar function.
There is now the ability to load a font via selectFont (three fonts included, Arial_14, Arial_bold_14 and System5x7)
After calling that function any text written will be output in that font.

I have also added a drawString function that allows you to write a full string at once
Finally I have added scrolling text (AKA marquee) via the 'drawMarquee' and 'stepMarquee' functions
By using this with the Arial_bold_14 font it makes quite a good notice display.

I have updated the examples included in the original library to use these new functions.
This is just a first go at adding some features so let me know if anyone has any suggestions for extra stuff :)

It can be downloaded from

Edit: Library now supports multiple gray levels, multiple buffers and screen transistions
See ... ansitions/

Re: Modified DMD library

Posted: Wed Jan 11, 2012 10:58 am
by jonoxer
That's brilliant! Thanks for pitching in: this is exactly what we hoped would happen when Marc did the first version of the library and we released the hardware. Unfortunately we don't have the resources to put a huge amount of time into it, but with a few people collaborating it can progress rapidly.

Because the DMD has received so much attention I've just created a GitHub repo to make it easier to track issues and patches. @debenham, do you have a GitHub account and experience with Git so you could submit your changes as a pull request or a patchset? If you don't that's fine of course, let me know and I'll merge your updated version in.


Re: Modified DMD library

Posted: Thu Jan 12, 2012 12:19 am
by debenham
I hadn't used github before - but now have ;)
I have setup a fork of the repo, made my changes and made the pull request
The change is a bit larger than it needs to be since it included my re-formating changes (not essential but made it easier to follow the code)
Let me know if I didn't do it right - I haven't used github previously (but it doesn't seem that different to sccs, cvs, bzr or hg which I have used before)

Next step - find a second DMD and get that working :)

Re: Modified DMD library

Posted: Thu Jan 12, 2012 12:31 am
by jonoxer
Hey Chris, thanks for setting up the pull request.

By the way, when I saw your name I puzzled over it for a moment because I *knew* it was familiar, but couldn't remember where from, then it suddenly came back to me: bashpodder and Lyricue! I used to use bashpodder on my desktop machine (no longer since I pull podcasts straight onto an Android phone now) and a few years ago I set up Lyricue at South Croydon Anglican Church here in Melbourne. I vaguely recall doing some Debian packaging or something for it at the time.

Anyway, thanks for your help with the DMD library, and keep your eyes open for a PM regarding that second panel ;-)

Re: Modified DMD library

Posted: Thu Jan 12, 2012 5:09 am
by debenham
I have just committed to my git clone ( ) a 'potential' support for multiple panels.
It doesn't break on a single panel but I can't test multi-panels so if someone else is willing to give it a try that would be great.

Re: Modified DMD library

Posted: Thu Jan 12, 2012 10:27 pm
by marc
Hi Chris,
Thanks this is awesome :)
Attached is a 'quick tweak' to the library, support for 2 panels across is tested and working!
This is just a quick one to get the revision back out there and back to you fast, I've not gone through checked and reworked the panel size/width/height values into a cleaner layout, fyi, just added in the panel width scaling to the scan and modified some routines to allow for the DisplaysWide.

We have some craziness here this week and next week for the Mini Maker Faire then the LCA conference next week, normally I would set up to push back to git etc but today it's quicker for me to drop a zip file back so here it is.


PS there's a modified example called "dmd_demo_2_panel_testing" in there for now, running 2 displays across with the text and scrolling text.

Re: Modified DMD library

Posted: Thu Jan 12, 2012 10:51 pm
by debenham
Thanks for that - I was putting the same image to all displays :P
I've updated my git with the changes (and a few other small adjustments so it should work for more than two displays as well)
I'll do a new pull request shortly

Re: Modified DMD library

Posted: Thu Jan 12, 2012 10:59 pm
by debenham
Note: you can create new fonts using GLCDFontCreator2
That can be grabbed from ... p&can=2&q=

Re: Modified DMD library

Posted: Tue Jan 17, 2012 1:35 am
by debenham
I have made some more changes so that the test patterns now handle multiple displays.
I've also re-worked some of the string/character handling and now outputting a string is about 3 times faster :)
Changes have been committed to git -

Re: Modified DMD library

Posted: Wed Jan 18, 2012 1:35 am
by debenham
I just fixed up the demo code to handle multiple displays better - just change the DISPLAYS_ACROSS and DISPLAYS_DOWN defines at the top to whatever is needed

I've just uploaded a video of the demo to youtube as