Line scrolling and wrapping

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
Jens
LCD?
Posts: 2
Joined: Wed Sep 21, 2005 12:57 pm

Line scrolling and wrapping

Post by Jens »

Hi,

I
Tom
Matrix Orbital
Matrix Orbital
Posts: 1030
Joined: Mon Jul 19, 2004 4:43 pm
Location: Calgary
Contact:

Post by Tom »

Hi Jens,

Thank you for posting on the forum.

When you enable the auto line wrap command, your text will print and wrap from row 1, 2, 3, and 4. If auto line wrap is off, the text will print and wrap from line 1, 3, 2, 4. If you have auto scroll on, once all the text reaches the end of the display, it will push all the other text above up, so you will be get a partially blank row, depending on how much text is being sent. If auto scroll is off, then the text will wrap back to the top row.

I hope this clarifys things for you.

Best Regards,
Jens
LCD?
Posts: 2
Joined: Wed Sep 21, 2005 12:57 pm

Post by Jens »

Hi Tom.

I was confused by the effect of the NEWLINE. I'm using the displays under Linux, addressing them directly via the /dev/ttyS* driver (serial line). So on the command line I had to enter RETURN key to transmit the string to the display (this is also a way to flush the internal buffers of the OS). Without NEWLINE it worked like expected. So I have to send the strings without NEWLINE at the end, each line adjusted to 20 characters, OK?

Here are my two examples, maybe it helps other people.

Thank you very much,
Jens


Line wrap example

Code: Select all


#!/usr/bin/perl -w
open(LCD,">/dev/ttyS3")||die "ERROR: can not write to /dev/ttyS..\n";
print LCD chr(0xFE),"X"; # clear the display

 print LCD chr(254),chr(67);    # wrap on
# print LCD chr(254),chr(68);   # wrap off

print LCD "abcdefghijklmnopqrstuvwxyz";
close LCD;
          


Line scroll example

Code: Select all


#!/usr/bin/perl -w
open(LCD,">/dev/ttyS0")||die "ERROR: can not write to /dev/ttyS..\n";
print LCD chr(0xFE),"X"; # clear the display

 print LCD chr(254),chr(81);    # scroll on
# print LCD chr(254),chr(82);   # scroll off

print LCD "line1               ";
print LCD "line2               ";
print LCD "line3               ";
print LCD "line4               ";
print LCD "line5               ";
close LCD;

Tom
Matrix Orbital
Matrix Orbital
Posts: 1030
Joined: Mon Jul 19, 2004 4:43 pm
Location: Calgary
Contact:

Post by Tom »

Your Welcome Jens,

Thank you for the examples. When you place a newline, the cursor just jumps to the beginning of the next line, so it is hard to see the effects of line wrapping or auto scrolling.

If you have anymore questions or concerns, please feel free to post them.

Best Regards,
Post Reply