Animated Scrolling Text in 16×2 LCD using 8051 Microcontroller

LCD’s are widely used where user interaction with the system is necessary and you might have come across static message display using LCD. The message displayed on the LCD can also be animated like blinking, scrolling etc. This article explains how to display a running or animated scrolling text in a 16 x 2 LCD display with a 8051 Microcontroller.

16 x 2 LCD:

16×2 LCD Display

In a 16 x 2 LCD a message is displayed by means of configuring it through commands initially and then send the data to be displayed on it. A two registers namely Command and Data register are used to serve this purpose in a LCD. Read more about Displaying static message in a LCD screen to acquire full knowledge about it.

It only take few extra steps to make text scrolling in a LCD screen. There are two specific commands which we use for the purpose of text scrolling. They are

0x18 – Shift Entire Display Left

0x1C- Shift Entire Display Right

Using these commands we have to shift our message either left or right continuously by means of placing it in an infinite loop. Doing this we can achieve the scrolling effect of Message in LCD from right to left or vice versa.

I would like to attach a file on Keil C code. How can I attach a file to the code.. What are the modifications that I should make in the code. Please let me know the exact code that includes this attaching The file that I would like to attach should contain the texts that I want to display on 16×2 LCD display

Praisy Samuel, I don’t think MCU’s have the capability to deal with files. So you cannot attach or use a file, you could if you add an external memory such as memory card but still you need to interpret them as per their format. All you can do is include the characters in a array and use them.

Hi Kalyani, Am not sure what you mean .txt file. If you mean to ask to display the characters in a .txt file, then the answer is you cannot do it. You should copy all the characters from the .txt file and then paste it in 8th line in this code instead of “Gadgetronicx”. Remember to extend the array size as per your requirement