New beta release "DMD2" Library

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
User avatar
stryker
Posts: 280
Joined: Sat Jan 14, 2012 2:44 pm

Re: New beta release "DMD2" Library

Post by stryker » Tue Jul 29, 2014 9:50 pm

RadioDJ wrote:I have now some more questions.
I will like to read some values from the memory in the Arduino, like brightness, width and heigth.
I will then use this values to setup the DMD2 library.
Is this possible??
I have done some expriment but have not solved this problem. Sample code??
Can you share what you've done so far? It's certainly possible to store parameters in EEPROM and read them back at startup. Height and width I've not given any thought to, but brightness certainly is possible.

Geoff

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

Re: New beta release "DMD2" Library

Post by Brissieboy » Wed Jul 30, 2014 12:37 am

RadioDJ,

Brightness is a parameter that you set yourself, so you should have no trouble getting that one.

Height and width: these are specific to a font and are available within the relevant libraries. They are not normally readily available within your sketch. They would be best accessed by adding functionality to the library. How you do this will depend on the library you are using.
Width can also be a bit confusing: width as defined in the font (only used for fixed width fonts)? width of a particular character (for variable width fonts)? width of a particular string?

But why do you need these? They will be set for you when you load a font. You normally do not need to access them.

You need to tell us more - follow stryker's advice and show us what you've done so far.

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

Re: New beta release "DMD2" Library

Post by Brissieboy » Wed Jul 30, 2014 1:53 am

Blinkles wrote
For some reason I can't get the Font3x5.h font to work, comes up with only 3 lines (top 3) of the font with the new DMD library.
This font operates correctly with the original versions of the DMD library so it looks like the problem might be in your sketch or the beta DMD2 library. I have not tried it with the DMD library.

BTW the font is not much use as it is just too hard to decipher being so few pixels - 5x7 is about the minimum acceptable.

RadioDJ
Posts: 11
Joined: Fri Sep 27, 2013 5:56 pm

Re: New beta release "DMD2" Library

Post by RadioDJ » Fri Aug 01, 2014 6:16 am

I shall try to explain more about the width and heigth.
When you start up the display you tell it how many displays you have (width and height).
This is done outside the "Setup".
I'm making a universal card I can use with several display settings. I had hope to use the same code and only send a command to the card to tell it what kind of display it shall go to, ex. 3 unit width and 5 unit height. After that, restart the card and everything is alright.
I shall not change the font so there I don't have any problem.

About the Brightness I have done some more expriment after I wrote the last message here and that problem I solved.

The width and height is used in:
SoftDMD dmd(WIDTH, HEIGHT); // Set the numbers of displays
in the example code.

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

Re: New beta release "DMD2" Library

Post by Brissieboy » Fri Aug 01, 2014 7:13 am

RadioDJ,

The DMDs are write only. There is no facility to read anything from them. There is no way for your sketch to determine how may DMDs are connected, or even if a DMD is connected.

Once again, these are parameters that the programmer must set.

RadioDJ
Posts: 11
Joined: Fri Sep 27, 2013 5:56 pm

Re: New beta release "DMD2" Library

Post by RadioDJ » Fri Aug 01, 2014 9:19 am

That I understand.
What I'm like to do is that I myself sets the values for width and height in the eeprom.
Then after a powerup I would like the program to read from the eeprom and then set this values in the "SoftDMD dmd(WIDTH, HEIGHT);".
Is this possible??

If you for example could put the "SoftDMD dmd(WIDTH, HEIGHT);" in the Setup then I could read the eeprom first and then put the values in the SoftDMD dmd string.

Have you checked the other question I wrote before regarding putting text in a Textbox?

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

Re: New beta release "DMD2" Library

Post by Brissieboy » Sat Aug 02, 2014 1:59 am

RadioDJ,

You certainly can store and retrieve values in EEPROM. All you need to do is include the EEPROM.h

Code: Select all

#include "EEPROM.h"
and then use the read and write operations. Have a look at this http://arduino.cc/en/Reference/EEPROM.
But once again, you should not need to do this as you already know exactly what these values are. Just use #defined values at the top of your sketch

Code: Select all

#define DISPLAYS_ACROSS 3
#define DISPLAYS_DOWN 2
then just use DISPLAYS_ACROSS and DISPLAYS_DOWN where ever you need these values.

Code: Select all

SoftDMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN);
Sorry if I am misunderstanding your requirements here.

As for the textbox question: the DMD2 library (as it currently stands) does not appear to support multiple textboxes. This sounds like it would be a useful feature to have available, especially when you have multiple DMDs.

Maybe angusgr will take it on board???

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 » Mon Aug 04, 2014 11:10 pm

Brissieboy wrote: As for the textbox question: the DMD2 library (as it currently stands) does not appear to support multiple textboxes. This sounds like it would be a useful feature to have available, especially when you have multiple DMDs.

Maybe angusgr will take it on board???
Multiple textboxes should work. You just need to declare multiple DMD_TextBox instances at the top of the sketch, and give them different instances - as DMD_TextBox(dmd, left, top, width, height), and they should co-exist as long as the regions don't overlap.

If this doesn't work, please let me know.

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

Re: New beta release "DMD2" Library

Post by victorhooi » Tue Aug 05, 2014 7:24 am

Hi,

I'm looking at using a few DMD boards daisy-chained together to show the time, taken from a RTC module. I have a few questions about using the DMD2 library:
  1. The Countdown.ino example has several lines that interact with Serial:

    Code: Select all

    Serial.begin(9600);
    ...
    Serial.print(counter);
    Serial.println(F("..."));
    
    Can you provide any more details on what these lines do?
  2. In your changelog, you mentioned integrated timer management. Can you explain what this means please?
  3. Does the brightness default to maximum? Or some other value? Also, can I confirm that 255 is the maximum? What is the minimum? (i.e. 0 or 1).
  4. What do dmd.fillScreen() and dmd.clearScreen() do?
  5. Does this library support daisy-chaining? Does it work the same as for the original DMD library? (i.e. you refer to it all as one big board with more coordinate points).
Regards,
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 » Wed Aug 06, 2014 11:33 pm

Hi Victor,

Sure thing, please find answers to your questions below.
victorhooi wrote:

Code: Select all

Serial.begin(9600);
...
Serial.print(counter);
Serial.println(F("..."));
Can you provide any more details on what these lines do?
Serial.begin(9600) initialises the serial port at 9600 bps. Reference here.

Serial.print(counter) outputs the current value of the counter variable to the serial port so it can be read in the Serial Monitor Arduino window (unders Tools -> Serial Monitor.) Reference here.

Serial.println(F("...")) prints the string ... (ie 3 periods) to the serial port and then ends the line (the previous print statement does not end the line, so the periods are printed right after the number. Reference here.

Writing F("...") rather than simply "..." is a trick that means the "..." is stored in flash memory on the Arduino rather than being loaded into RAM - this is useful with constant strings that don't change, as it saves some RAM, but it's not strictly necessary. It is documented under the "Print" documentation linked above.
[*] In your changelog, you mentioned integrated timer management. Can you explain what this means please?
In the original DMD library example sketches, you'll see a lot of code involved with using the "Timer1" feature of the Arduino microcontroller to automatically refresh the display at the correct interval. In DMD2 all of this timer code is integrated in the library for simplicity, you don't need to include it in each sketch you write.
[*] Does the brightness default to maximum? Or some other value? Also, can I confirm that 255 is the maximum? What is the minimum? (i.e. 0 or 1).
It defaults to maximum, which is 255. 0 is the minimum, but the display will be off in this case. The display may not be visible at brightness level 1 or 2.
[*] What do dmd.fillScreen() and dmd.clearScreen() do?
The former turns on every LED, the latter turns off every LED.
[*] Does this library support daisy-chaining? Does it work the same as for the original DMD library? (i.e. you refer to it all as one big board with more coordinate points).[/list]
Yes, absolutely. The "GameOfLife" example probably has the best example code for this at the moment:

Code: Select all

// How many displays do you have?
const int WIDTH = 2;
const int HEIGHT = 1;

SoftDMD dmd(WIDTH,HEIGHT);
Allowing you to create a large integrated display.

Apologies for the still-slow progress on the DMD2 beta, but I'll hopefully get some more time to finish it off soon.


Angus

Post Reply