DMD text editing PS2 keyboard

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
Post Reply
romady
Posts: 4
Joined: Sun Apr 21, 2013 7:00 am

DMD text editing PS2 keyboard

Post by romady » Sun Apr 21, 2013 7:23 am

can help me to DMD keyboard interfacing

thenks

romady
Posts: 4
Joined: Sun Apr 21, 2013 7:00 am

Re: DMD text editing PS2 keyboard

Post by romady » Mon Apr 22, 2013 8:49 am

yes right.....

romady
Posts: 4
Joined: Sun Apr 21, 2013 7:00 am

Re: DMD text editing PS2 keyboard

Post by romady » Mon Apr 22, 2013 8:56 am

this my code, but not running perfect.

Code: Select all

#include <Ethernet.h>
#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 <PS2Keyboard.h>
#include "SystemFont5x7.h"
#include "Arial_black_16.h"
//Fire up the DMD library as dmd
#define DISPLAYS_ACROSS 2
#define DISPLAYS_DOWN 1
#define DISPLAYS_BPP 1
#define WHITE 0xFF
#define BLACK 0
DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN, DISPLAYS_BPP);
const int DataPin = 5;
const int IRQpin =  3;
PS2Keyboard keyboard;
void ScanDMD()
{ 
  dmd.scanDisplayBySPI();  
}
boolean mulai = false; 
boolean akhir = false; 
String anto;
String ayu;
int jumlah;
void setup(void){
  ///Ethernet.begin(mac);
  Serial.begin(9600);
  //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()
    keyboard.begin(DataPin, IRQpin);
    //textswe=('testing');
}

void loop(){
  while (keyboard.available()) {
    char c = (char)keyboard.read();
    if (c == '{')
    {
      mulai = true;
    }
    if (c == '}')
    {
      akhir = true;
    }
    if (mulai && c != '{'  && c != '}')
    {
      anto += c;
    }
    if (c == PS2_ENTER){
      mulai = false;
      akhir = false;
      anto += '\r';
     Serial.print(anto);
 ayu=anto;//
      anto = "";
    }
  }
char buff[256];
      ayu.toCharArray(buff,256);
   dmd.selectFont(Arial_Black_16);
   int jumlah= anto.length();
   dmd.drawMarquee(buff,jumlah,(32*DISPLAYS_ACROSS)-1,0,WHITE,BLACK);
   long start=millis();
   long timer=start;
   boolean ret=false;
   while(!ret){
     if ((timer+50) < millis()) {
       ret=dmd.stepMarquee(-1,0);
       timer=millis();
     }
  }   
}

romady
Posts: 4
Joined: Sun Apr 21, 2013 7:00 am

Re: DMD text editing PS2 keyboard

Post by romady » Tue Apr 23, 2013 12:41 am

sorry forgot to delete it, i don't need.
whether the disturb?
when i input some characters and push enter then text running, but one or some character lost :?:

Post Reply