may you help me please to know from where can i get Arabic font for DMD?
i have 16X32 DMD and its working fine with English ,but i hope if i can display Arabic font.
thanks in advance.
Code
#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 Budrate 9600
#define DISPLAYS_ACROSS 2
#define DISPLAYS_DOWN 1
DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN);
/--------------------------------------------------------------------------------------
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 ); //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()
dmd.clearScreen( true ); //true is normal (all pixels off), false is negative (all pixels on)
Serial.begin(Budrate);
}
void loop(void)
{
dmd.clearScreen( true );
dmd.selectFont(Arial_Black_16);
String content = "";
char character;
while(Serial.available())
{
character = Serial.read();
content.concat(character);
// delay (10);
}
if (content != "")
{
Serial.println(content);
}
char *txt;
txt=&content[0];
dmd.clearScreen( true );
for (byte x=0;x<DISPLAYS_ACROSS;x++) {
for (byte y=0;y<DISPLAYS_DOWN;y++) {
if(content.length()==6)
dmd.drawString( 5, 1+(16y), txt,content.length(), GRAPHICS_NORMAL );
if(content.length()==5)
dmd.drawString( 10, 1+(16y), txt,content.length(), GRAPHICS_NORMAL );
else if(content.length()==4)
dmd.drawString( 15, 1+(16y), txt,content.length(), GRAPHICS_NORMAL );
//Ahmed rememeber that MEssage must be more or = 7 Char.
else if(content.length()>=7)
{
dmd.drawMarquee(txt,content.length(),(32DISPLAYS_ACROSS)-1,0);
long start=millis();
long timer=start;
boolean ret=false;
while(!ret){
if ((timer+30) < millis()) {
ret=dmd.stepMarquee(-1,0);
timer=millis();
}
}
}
}
}
delay( 500 );
}