DMD PWM

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
VizzTech
Posts: 5
Joined: Fri Jun 22, 2012 12:02 pm

Re: DMD PWM

Post by VizzTech » Wed Jun 27, 2012 7:33 am

milamber - sounds great, I look forward to hearing from you.

milamber
Posts: 12
Joined: Wed Mar 14, 2012 7:08 am

Re: DMD PWM

Post by milamber » Sun Jul 08, 2012 3:46 am

Well I am late again....sadly as usual. But I hope the wait has been worth it as I am going to bite the bullet and post the library. Its still not great but its about as good as I am going to get it. I am compiling it on IDE 0022 so I don't know how it will go in the newer IDE.

There is an included example that runs some nice effects on 1 and 2 boards. I hope I have made it straight forward enough. Just like a normal library make sure the IDE is closed, unzip this into your arduino\libraries folder then start up the IDE and it should be there in the sketchbook/examples area under File.

I have made this for my video wall project and it works how I need it to. As such I will try to help but if there are things that aren't working for you I strongly suggest having a go at fixing it yourself. This is only a modification to an existing library to make it work with the DMD hardware, all credits back to ElcoJacob for creating the base library. As with all of this if you wish to improve or change the code feel free to do so but please credit those who were before you.

I hope this helps people with their projects. :D Enjoy!
Attachments
DmdPWM.zip
DMD PWM Library
(15.98 KiB) Downloaded 515 times

milamber
Posts: 12
Joined: Wed Mar 14, 2012 7:08 am

Re: DMD PWM

Post by milamber » Sun Oct 21, 2012 2:23 pm

Once again long time between posts.....but we have progress.
I have obtained a USB to Serial adapter and have now tested connecting the TX of that to the RX of 2 Arduino's. This is what I have been banking on the whole time and it worked perfectly. Each Arduino waits for an assigned start byte and then acts on the bytes following the start byte. It then counts the bytes until it has a full module worth and displays them. The next start byte is received by the next Arduino and the sequence is repeated. This is how I plan to scale up to having 4 Arduino's working together, each controlling 2 DMD's. Thereby giving me a 64x64 resolution LED video screen.

Please have a look at the 2 videos below. I used my camera phone and it is not great at capturing the LED's as they are quite bright. So I apologize for the image quality.
http://vimeo.com/51850108
http://vimeo.com/51850109

xz81
Posts: 6
Joined: Thu Jul 05, 2012 8:17 am

Re: DMD PWM

Post by xz81 » Sun Oct 21, 2012 3:27 pm

Amazing!!

I don´t understand almost any when you speak about interrupts and bytes, but the final result is COOL.

I read this topic because I was looking a way to manage the brightness in high power. I read something than 3 bytes are enought to 7 levels but there is not a big difference. It is possible to make it?. I mean, with a pair of code lines in one sketch.

Thank you and congratulations

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

Re: DMD PWM

Post by Brissieboy » Sun Sep 22, 2013 1:02 am

I have just downloaded the DmdPWM library but I am having trouble getting the example to compile 'out of the box'.
I have had no trouble with other libraries.
The libraries are installed in the correct directory structure.
I am using Arduino 1.0.5 with a Uno on Windows 7.
It appears that I am missing a header file somewhere. Here are the error messages:

Code: Select all

C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp: In destructor 'CDmdPWM::~CDmdPWM()':
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:56: error: 'free' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp: In member function 'bool CDmdPWM::IsValidPin(int, int)':
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:62: error: 'Serial' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:65: error: 'DEC' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:68: error: 'delay' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:72: error: 'Serial' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:78: error: 'delay' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp: In member function 'void CDmdPWM::OneByOne_core(int)':
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:117: error: 'delay' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:121: error: 'delay' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp: In member function 'void CDmdPWM::SetMatrixSize(int, int)':
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:128: error: 'cli' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:139: error: 'realloc' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:145: error: 'sei' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:153: error: 'Serial' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:154: error: 'sei' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp: In member function 'bool CDmdPWM::LoadNotTooHigh()':
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:166: error: 'Serial' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp: In member function 'void CDmdPWM::Start(int, unsigned char)':
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:194: error: 'Serial' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:195: error: 'cli' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp: In member function 'void CDmdPWM::InitTimer1()':
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:204: error: 'bitSet' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:205: error: 'bitClear' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:223: error: 'round' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp: In member function 'void CDmdPWM::InitTimer2()':
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:234: error: 'bitClear' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:235: error: 'bitSet' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:241: error: 'round' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp: In member function 'void CDmdPWM::PrintInterruptLoad()':
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:293: error: 'Serial' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:303: error: 'Serial' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:309: error: 'micros' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:311: error: 'delayMicroseconds' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:318: error: 'bitClear' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:321: error: 'bitClear' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:328: error: 'delayMicroseconds' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:344: error: 'Serial' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:348: error: 'DEC' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:358: error: 'bitSet' was not declared in this scope
C:\Users\Trev - Admin\Documents\Arduino\libraries\DmdPWM\CDmdPWM.cpp:366: error: 'bitSet' was not declared in this scope
Appreciate any help please.
Brissieboy

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

Re: DMD PWM

Post by RuralGeek » Sat Sep 28, 2013 3:35 am

The trouble is that a number of things changed with v1.0 - for example wprogram.h became arduino.h

If someone could point out where the other changes are then this library could be made useful again.

e.g. these snippets of code are 'broken' as well:

Code: Select all

CDmdPWM::~CDmdPWM() {
	if(m_PWMValues!=0){
		free( m_PWMValues ); <<<----- issues with free
	}
}

Code: Select all

bool CDmdPWM::IsValidPin(int row, int col){
	if(row>=m_amountOfRows*4){
		Serial.print("Error: Trying to write duty cycle of row ");
		Serial.print(row);
		Serial.print(" , while number of rows is ");
		Serial.print(m_amountOfRows,DEC); 
		Serial.print(" , numbered 0-");
		Serial.println(m_amountOfRows-1, DEC); <<<<<--- issues with both serial and DEC
		delay(1000);
		return 0;	
	}

Post Reply