Page 1 of 1
Line scrolling and wrapping
Posted: Wed Sep 21, 2005 1:11 pm
by Jens
Hi,
I
Posted: Wed Sep 21, 2005 3:24 pm
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,
Posted: Thu Sep 22, 2005 5:19 am
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;
Posted: Thu Sep 22, 2005 10:17 am
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,