Static Text display on P10 LED Display

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
Post Reply
NomanJameel
Posts:5
Joined:Thu Feb 27, 2020 3:50 pm
Static Text display on P10 LED Display

Post by NomanJameel » Mon Mar 02, 2020 4:07 am

Good Morning Everyone.
i'm trying to display static text to p10 led module via arduino ethernet shield please help me where i am wrong
this is my code...

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"

#include <Ethernet.h>

// Enter a MAC address and IP address for your controller below.

 

// The IP address will be dependent on your local network.
// gateway and subnet are optional:
 byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
    byte ip[] = { 192, 168, 1, 125 }; // ip in lan
    byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
    byte subnet[] = { 255, 255, 255, 0 }; //subnet mask

// telnet defaults to port 23
EthernetServer server(23);
boolean alreadyConnected = false; // whether or not the client was connected previously





//Fire up the DMD library as dmd
#define DISPLAYS_ACROSS 1
#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();
}

String inputString = "";
char c;

void setup()
{
 
   Ethernet.begin(mac, ip, gateway, subnet);
  // start listening for clients
  server.begin();
 
 
   Timer1.initialize( 5000 );        
   Timer1.attachInterrupt( ScanDMD );
   dmd.clearScreen( true );
   Serial.begin(115200);
}

void loop()
{
 
  EthernetClient client = server.available();
 
  dmd.selectFont(Arial_Black_16);

dmd.clearScreen( true );
if(client.available())
{
c = client.read();
inputString += c;
}
char newStrings[256];
int  sLength=inputString.length();
inputString.toCharArray(newStrings,sLength+1);
dmd.drawString(0,0,newStrings,sLength,GRAPHICS_NORMAL);

delay(1000);
dmd.clearScreen( false );
//dmd.drawMarquee(newStrings,sLength,(32*DISPLAYS_ACROSS)-1,0);
//
//
////dmd.drawMarquee("Scrolling Text testing",22,(32*DISPLAYS_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(2);
}

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

Re: Static Text display on P10 LED Display

Post by Brissieboy » Mon Mar 02, 2020 4:51 am

Firstly, please put your code in the code markers - shown as </> in the line above the text entry box. I have just edited your post to do this, as I did in your previous thread.
You do not give much information.
What is going wrong? What is happening that shouldn't be happening, or what is not happening that should happening?
What have you done to debug it yourself?
And as this appears top be part of some exam assignment (as you mentioned in your previous thread) you really should be making a reasonable effort yourself and not expecting others to solve your problems for you.

NomanJameel
Posts:5
Joined:Thu Feb 27, 2020 3:50 pm

Re: Static Text display on P10 LED Display

Post by NomanJameel » Mon Mar 02, 2020 5:07 am

Sir sorry for that i'm new in this form i try my best but no luck. im using arduino uno with ethernet shield. i just want to display static text on p10 module

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

Re: Static Text display on P10 LED Display

Post by Brissieboy » Mon Mar 02, 2020 10:30 am

So as I asked:
What is going wrong? What is happening that shouldn't be happening, or what is not happening that should be happening?
What have you done to debug it yourself?

Have you tried to print something direct to the DMD? Did it work? If so the DMD display part looks OK.
Are you receiving data as expected from the ethernet shield? Have you tried sending it to the serial monitor to check? Did it work correctly? If so that part looks OK.
If both work OK then there is likely a problem with how you handle the received message and pass it to the display task.
Just work on small functional parts and get each of them working properly, then start putting them together.

Post Reply