It is same like we display moving text on our java applications or the text that you see on news channel at the bottom moving from left to right. In this project I used a 16×2 lcd with 8051(89c51,89c52) microcontroller. 16×2 lcd is used in 8-bit mode. If you don’t know 8-bit mode than just click the link and you will have a good tutorial.
Difference between 8-bit and 4-bit lcd mode. Their are two ways to Scroll-move Text on lcd
|
Scrolling lcd display first method
Coming to the code. First include the necessary library reg51.h that is to be included in every project where you are using 8051(89c51,89c52,89s51,89s52 etc) series microcontrollers in your project. Then Port-3 pins 5 and 6 are used as rs(register set) and en(enable) pins for lcd control . If you dont know what they are you can have a good tutorial here.
Then I defined the string which i want to scroll on the lcd in the form of character array c[15]. Then some commands are defined they are actually moving the cursor one step back after each cycle.
The rest of the code is delay() function to give necessary delay where needed. lcdint() Function to initialize lcd. lcdcmd() is sending commands to lcd. Display() function is sending data to lcd for display. Dont know Commands and Data Send to Lcd. Here is a good tutorial.
Port-1 is used to send data and commands to the lcd. Port-1 is connected to Data pins of lcd.
The more easy way is to scroll the text using standard lcd commands. The code is same like the above method. The only change is in the main function & now the text which i am going to scroll is my web site name “microcontroller-project.com”.
In the main function only the command 0x18 is performing the function of scrolling-moving. It scrolls the printed letter to wards one step left. In the main function while loop prints each letter once and then calls the 0x18 command which moves whole of the text to wards left.From whole of the text i mean the letters which are printed previously and printed in the current instruction.
Note: I am continuously scrolling the text on lcd.
Filed Under: 8051 Microcontroller, Microcontroller Projects
Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.