display Text without Scrolling on P10 LED Module using Arduino UNO

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
display Text without Scrolling on P10 LED Module using Arduino UNO

Post by NomanJameel » Thu Feb 27, 2020 4:03 pm

Hi Everyone
i am using P10 LED module with Arduino Uno and Arduino Ethernet Shield.what ever i send using ethernet Shield text will Scroll and i dont want to
scroll.please help me i am not well in programming and this is urgent for me
this is my code

Code: Select all

#include <SPI.h>        //SPI.h must be included as DMD is written by SPI (the IDE complains otherwise)
#include <Ethernet.h>
#include <DMD.h>        
#include <TimerOne.h>   
#include "SystemFont5x7.h"
#include "Arial_black_16.h"
#include <SoftwareSerial.h>// import the serial library

SoftwareSerial testserial(2, 3); // RX, TX
//Fire up the DMD library as dmd
#define DISPLAYS_ACROSS 1
#define DISPLAYS_DOWN 1
DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN);
//number max of characters in your message
#define max_char 100
char message[max_char];    // stores you message
//char mess[max_char];
char r_char;               // reads each character
byte index = 0;            // defines the position into your array
int i;            
//char greeting[] = "MyEngineeringStuffs";

// Arduino server MAC address
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// Arduino server IP address
IPAddress ip(192, 168, 1, 10);
// Arduino server port
const int port = 23;
 
EthernetServer server(port);

void ScanDMD()
{ 
  dmd.scanDisplayBySPI();
}

void setup(void)
{
   
    Ethernet.begin(mac, ip);
    server.begin();
    
   //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 (5s) 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( true );   //true is normal (all pixels off), false is negative (all pixels on)
   testserial.begin(9600); //Software serial initialization
   Serial.begin(9600);
//strcpy(message,greeting);
}
void loop(void)
{
   //check if serial is avaible an before reading a new message delete's the old message
     EthernetClient client = server.available();
     
   if(client.available())
   {       
        for(i=0; i<99; i++){
            message[i] = '\0';
            Serial.print(message[i]);
        } 
        //resests the index        
        index=0;
    }

    //while is reading the message 
    while(client.available() > 0){
       //the message can have up to 100 characters 
       dmd.clearScreen( true );
       if(index < (max_char-1)) 
       {         
           r_char = client.read();      // Reads a character
           message[index] = r_char;     // Stores the character in message array
           index++;                     // Increment position      
       } 
   }
    
 //prepares the display to print our message
   dmd.selectFont(Arial_Black_16);
   //displays the message
   dmd.drawMarquee(message ,max_char,(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();
     }
   }
}

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

Re: display Text without Scrolling on P10 LED Module using Arduino UNO

Post by Brissieboy » Thu Feb 27, 2020 11:09 pm

It is the dmd.drawMarquee() & dmd.stepMarquee() that does the scrolling.
Replace this

Code: Select all

   dmd.drawMarquee(message ,max_char,(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();
     }
   }
with this

Code: Select all

dmd.drawString(x, y, message, max_char, WHITE, BLACK );
The x and y are the starting coordinates - with 0 and 0 being the bottom left hand corner.

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

Re: display Text without Scrolling on P10 LED Module using Arduino UNO

Post by NomanJameel » Fri Feb 28, 2020 5:17 am

Dear Brissieboy
in this code

dmd.drawString(x, y, message, max_char, WHITE, BLACK );
please tell me what is white and black
when i upload this programm its show this error
Attachments
Capture.JPG

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

Re: display Text without Scrolling on P10 LED Module using Arduino UNO

Post by NomanJameel » Fri Feb 28, 2020 6:15 am

Dear i change into
dmd.drawString(0, 0, message, max_char, GRAPHICS_NORMAL );

Sketch upload successfully but when i sent text via Hercules its show Connection refused by remote host
Someone can help me Please today is my exam please check the image
Attachments
Capture2.JPG

Post Reply