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
You are here: Home / Topics / Problem in LCD text animation

Problem in LCD text animation

|

Projects › Projects › Problem in LCD text animation

  • This topic has 2 replies, 2 voices, and was last updated 9 years, 5 months ago by pradeep.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 9, 2013 at 2:11 pm #2177
    pradeep
    Participant

    hello sir….
    Im displaying few text on LCD 16×2. I’m able to shift the display to right. But I want to sift it to left.

    //below string is for shifting the display to right....
    lcdcmd(0x1C); //Shift the entire display to right

    What is the command to shift the entire display to left?

    Please help.

    March 11, 2013 at 4:02 pm #9296
    AJISH ALFRED
    Participant

    Hi Pradeep,

     

    //LcdCommandWrite(0x18); // shift display and cursor to the left
    //LcdCommandWrite(0x1c); // shift display and cursor to the right

     

    Hope this helps you.

    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.
  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Basic questions about MOSFETS, Gate Drivers and Diodes August 9, 2022
  • LTSpice DC-AC August 9, 2022
  • Circuit Problem August 8, 2022
  • Google translate suggest "device sheet" or "apparatus sheet" but that cannot be ? August 8, 2022
  • Right channel distortion on vintage fisher rs-2010 August 8, 2022

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2022 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