It wasn't plug in and fire it up as described. I had to change the code to suit Arduino 1.0 - which was surprising considering that was/is the latest version of the IDE, plus I am not about to backport it as all the other code I have written works fine under Arduino 1.0 IDE. After that it seems to run quite ok.
The libraries available for the DMD - the drawMarquee function for example - does not seem to handle strings very well, unlike LCD and Serial print functions. I was trying to have a fixed string appended by output from a FT HUMID sensor, and have the complete string passed to the drawMarquee with the length so it scrolls properly. The DHT functions have been removed for clarity for now.
Code: Select all
/*--------------------------------------------------------------------------------------
Includes
--------------------------------------------------------------------------------------*/
#include <SPI.h> //SPI.h must be included as DMD is written by SPI (the IDE complains otherwise)
#include <DMD.h> //
#include <TimerOne.h> //
#include "SystemFont5x7.h"
#include "Arial_black_16.h"
//Fire up the DMD library as dmd
#define DISPLAYS_ACROSS 1
#define DISPLAYS_DOWN 1
#define DISPLAYS_BPP 1
#define WHITE 0xFF
#define BLACK 0
DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN, DISPLAYS_BPP);
/*--------------------------------------------------------------------------------------
Interrupt handler for Timer1 (TimerOne) driven DMD refresh scanning, this gets
called at the period set in Timer1.initialize();
--------------------------------------------------------------------------------------*/
void ScanDMD()
{
dmd.scanDisplayBySPI();
}
/*--------------------------------------------------------------------------------------
setup
Called by the Arduino architecture before the main loop begins
--------------------------------------------------------------------------------------*/
void setup(void)
{
//initialize TimerOne's interrupt/CPU usage used to scan and refresh the display
Timer1.initialize( 5000/DISPLAYS_BPP ); //period in microseconds to call ScanDMD. Anything longer than 5000 (5ms) and you can see flicker.
Timer1.attachInterrupt( ScanDMD ); //attach the Timer1 interrupt to ScanDMD which goes to dmd.scanDisplayBySPI()
//clear/init the DMD pixels held in RAM
dmd.clearScreen( BLACK ); //true is normal (all pixels off), false is negative (all pixels on)
}
/*--------------------------------------------------------------------------------------
loop
Arduino architecture main loop
--------------------------------------------------------------------------------------*/
void loop(void)
{
// 10 x 14 font clock, including demo of OR and NOR modes for pixels so that the flashing colon can be overlayed
// half the pixels on
dmd.drawTestPattern( PATTERN_ALT_0 );
delay( 1000 );
// the other half on
dmd.drawTestPattern( PATTERN_ALT_1 );
delay( 1000 );
dmd.clearScreen( BLACK );
dmd.selectFont(Arial_Black_16);
//Set String
char* txt2Disp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
//Add DHT output
//
//
//Length of final string
//
//
dmd.drawMarquee(txt2Disp,26,(32*DISPLAYS_ACROSS)-1,0,WHITE,BLACK);
long start=millis();
long timer=start;
boolean ret=false;
while(!ret){
if ((timer+35) < millis()) { // Change +35 for delay
ret=dmd.stepMarquee(-1,0);
timer=millis();
}
}
// stripe chaser
for( b = 0 ; b < 20 ; b++ )
{
dmd.drawTestPattern( (b&1)+PATTERN_STRIPE_0 );
delay( 200 );
}
delay( 200 );
}
I found that ALL of the small black screw hole posts has cracked, some had fallen off completely. I gave the remaining ones a light touch with my small plastic probe, and they fell away too.
I am now left with a display shroud that is not fixed to the PCB at all
