Pages: [1]   Go Down
Author Topic: seperate rows on character LCD screen 16x2??  (Read 909 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello!! i have a character LCD screen 16x2 and I want to make the rows scroll separately. For example, I want the first row to scroll and the second one not to scroll. Is it possible? Thank you!! smiley smiley smiley
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4545
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello!! i have a character LCD screen 16x2 and I want to make the rows scroll separately. For example, I want the first row to scroll and the second one not to scroll. Is it possible? Thank you!! smiley smiley smiley

Anything's possible in software, the question is "how difficult?"

Many displays can do the scrolling for you, problem is: We're not telepathic and don't know what display you have.

Logged

No, I don't answer questions sent in private messages...

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, you can. I typically write to those displays via a buffer: I would update the buffer and then write the whole buffer to the display.

In your case, you just call the lcd update function periodically. In each call, update the buffer and write to the lcd.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4108
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Many displays can do the scrolling for you, problem is: We're not telepathic and don't know what display you have.
The term 16x2 would generally lead one to believe that he is using a character mode LCD controlled by an HD44780 type controller.  As he has discovered, this controller cannot inherently shift one line without the other and I don't know of any libraries that do this in software.  

A similar but possibly easier approach than the buffer idea (depending on the application) would be to shift both lines and then rewrite the line that you didn't want to change.  

Note that I use the term 'shift' instead of 'scroll' because that's how it is described in the LCD controller data sheet.   For some insight into the problem check out the LCD Addressing link at http://web.alfredstate.edu/weimandn.


Don
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 64
Posts: 6889
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I favor software solution with a buffer slightly over shifting with hardware and then rewriting content that is not changing. If you expand to a larger display such as 20x4, and you still want a particular line to scroll or shift, then it's much easier to use a buffer. You can write a subroutine to do scroll on any line (with separate buffers). Then trying to use hardware shift will be awkward with rewriting 3 lines that are not moving. When using buffers, make sure you fill them with space characters first. With buffers, you can do lots of fancy stuff, such as expanding from center:

Quote

          W!
        Wee!
      Welme!
    Welcome!
Logged


Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
In your case, you just call the lcd update function periodically. In each call, update the buffer and write to the lcd.

Let me expand a little bit. Let's say that your display buffer is vBuffer[]="Display Buffer123!" initially.

1) display vBuffer[]; Display shows "Display Buffer123!";
2) left shift buffer  by 1, and display shows "isplay Buffer123! ";
3) left shift buffer by 1, and display shows "splay Buffer123!  ";
...

If you do it quick enough, it appears to the user that the string is being pushed left off the lcd -> scrolling.

With that approach, you can do more complicated effect, like exploding strings, string compression, etc.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thank you!! i 'll try all your suggestions and i 'll inform you if i find any problem! thanks!!
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 64
Posts: 6889
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If I implement buffer, I will use two pointers instead of actually shifting the buffer content if I want scroll without losing characters to the left edge.
Logged


Pages: [1]   Go Up
Jump to: