It displays correctly for me, however you need to change line 62 from
Code: Select all
Serial.println(readString);
Code: Select all
Serial.println(myString);
Code: Select all
Serial.println(readString);
Code: Select all
Serial.println(myString);
Code: Select all
#include "SPI.h"
#include "DMD.h"
#include "TimerOne.h"
#include "Arial_black_16.h"
#include "SystemFont5x7.h"
#define DISPLAYS_ACROSS 1
#define DISPLAYS_DOWN 1
DMD dmd( DISPLAYS_ACROSS , DISPLAYS_DOWN );
void ScanDMD()
{
dmd.scanDisplayBySPI();
}
void setup() {
Serial.begin(9600);
Serial.println("Demo !");
Serial.println();
Timer1.initialize( 5000 );
Timer1.attachInterrupt( ScanDMD );
dmd.clearScreen( true );
}
void drawText( String dispString )
{
dmd.clearScreen( false );
char newString[256];
int sLength = dispString.length();
dispString.toCharArray( newString, sLength+1 );
dmd.selectFont( Arial_Black_16 );
dmd.drawString( 0, 0, newString ,sLength, GRAPHICS_INVERSE);
}
//============
void loop(void) {
drawText("123");
delay( 1000 );
}
Code: Select all
this->drawLine(bX + strWidth , bY, bX + strWidth , bY + height, GRAPHICS_INVERSE);
Code: Select all
dmd.clearScreen( false );
Code: Select all
dmd.clearScreen( true );
Code: Select all
dmd.drawString( 0, 0, newString ,sLength, GRAPHICS_INVERSE);
Code: Select all
dmd.drawString( 0, 0, newString ,sLength, GRAPHICS_NORMAL);
Code: Select all
clearScreen(true)
Code: Select all
clearScreen(false)
Code: Select all
//drawText("123");
dmd.drawString( 0, 0, newString ,sLength, GRAPHICS_INVERSE);
Code: Select all
#include "SPI.h"
#include "DMD.h"
#include "TimerOne.h"
#include "Arial_black_16.h"
#include "SystemFont5x7.h"
#include "Arial14.h"
#define DISPLAYS_ACROSS 1
#define DISPLAYS_DOWN 1
DMD dmd( DISPLAYS_ACROSS , DISPLAYS_DOWN );
String inputString = ""; // a string to hold incoming data
boolean stringComplete = false; // whether the string is complete
String commandString = "";
void ScanDMD()
{
dmd.scanDisplayBySPI();
}
void setup() {
Serial.begin(9600);
Serial.println("Demo !");
Serial.println();
Timer1.initialize( 5000 );
Timer1.attachInterrupt( ScanDMD );
dmd.clearScreen( false );
drawText("000");
}
void drawText( String dispString )
{
dmd.clearScreen( false );
char newString[256];
int sLength = dispString.length();
dispString.toCharArray( newString, sLength+1 );
dmd.selectFont( Arial_Black_16 );
dmd.drawString( 2, 0, newString ,sLength, GRAPHICS_INVERSE);
}
//============
void loop(void) {
while (Serial.available() > 0 ) {
String str = Serial.readString();
dmd.clearScreen( false );
Serial.println("Input: " + str);
stringComplete = false;
drawText(str);
delay( 1000 );
}
}
Code: Select all
this->drawLine(bX + strWidth , bY, bX + strWidth , bY + height, GRAPHICS_INVERSE);
Code: Select all
this->drawLine(bX + strWidth , bY, bX + strWidth , bY + height, GRAPHICS_INVERSE);