EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies /  Thanku sir. I have used the

 Thanku sir. I have used the

|

Projects › Projects › Problem in LCD text animation ›  Thanku sir. I have used the

March 13, 2013 at 5:57 pm #9309
pradeep
Participant

 

Thanku sir.
 
I have used the following code from this site but making a little changes to it in order to get display on both rows of LCD & also shift them towards left.
But once the entire display is shifted to left, it doesnot re-displayes form the right (as in the case of original code to shift the display to right).
Text is displayed when the entire text is at its initial position & then it again starts moving left.
 
 
 
// Program to display dynamic text on LCD 
 
#include<reg51.h>
#define msec 50
sbit rs=P3^0;   //Register select (RS)
sbit rw=P3^1;   //Read write (RW) pin
sbit en=P3^6;   //Enable (EN) pin
unsigned char commands[]={0x38,0x0E,0x01,0x06,’’};  //Command to be sent to LCD
unsigned char command[]={0x38,0x0E,0xc0,’’};  //Command to be sent to LCD
char name[]={“COLLEGE”};    //String to be displayed on LCD
char nam[]={“NAME”};    //String to be displayed on LCD
void delay(unsigned int time)  //Time delay function
{
unsigned int i,j;
for(i=0;i<time;i++)
  for(j=0;j<1275;j++);
}
 
void lcdcmd(unsigned char value)  //Function for sending values to the command register of LCD
{
P2=value;
rs=0;
rw=0;
en=1;
delay(1);
en=0;
return;
}
 
void display(unsigned char value)  //Function for sending values to the data register of LCD
{
P2=value;
rs=1;
rw=0;
en=1;
delay(1);
en=0;
return;
}
 
void main()
{
int i,j;
for(i=0;commands!=’’;i++)  //Sending string to LCD
{
  lcdcmd(commands);
  delay(msec);
}
for(j=0;name[j]!=’’;j++)
{
  display(name[j]);
  delay(msec);
}
  for(i=0;command!=’’;i++)  //Sending string to LCD
{
  lcdcmd(command);
  delay(msec);
}
for(j=0;nam[j]!=’’;j++)
{
  display(nam[j]);
  delay(msec);
}
while(1)
{ 
  lcdcmd(0x18);  //Shift the entire display to left
  delay(75);
}
}
 
 
also Im using AT89c51 so I want to use port P0 insted of port P2 in the above code. How to do that plz help.

RSS Recent Posts

  • Getting into an LED bulb April 21, 2026
  • understanding of resonance in time domain April 21, 2026
  • Beginner Questions About CNC Machines – G-code, Control Systems & Accuracy April 21, 2026
  • A Must-Watch Video Showing Dangerous Construction of Cheap Lithium-Ion Cells April 21, 2026
  • S1MJ ? April 20, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise