Go Down

Topic: seperate rows on character LCD screen 16x2?? (Read 1 time) previous topic - next topic

alex_korpas92

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!! :) :) :)

fungus


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!! :) :) :)


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.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

dhenry

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.

floresta

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

liudr

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!

dhenry

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.

alex_korpas92

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

liudr

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.

Go Up