Wrap-around and scrolling support for LCDs
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Wrap-around and scrolling support for LCDs

by sridhar_rajagopal on Thu May 30, 2013 12:55 pm


I had updated the Adafruit_CharLCD.py to include support for automatically wrapping around longer text, and also added a new method for scrolling arbitrary length text from right to left (just call lcd.scrollingMessage("This is a really long message that will scroll slowly from left to write") ), when doing my Instructable for a Raspberry Pi Stock Ticker (see http://www.instructables.com/id/Raspber ... store-LCD/).

I also added code to make it work with my 8x2 (that looks like a 16x1) surplus store LCD.

I thought the changes might interest others working with LCDs too, so I'm sharing it here. It would not allow me to upload a .py file, so I've renamed them to .txt - don't forget to rename to .py!

(1.01 KiB) Downloaded 166 times
(8.16 KiB) Downloaded 185 times

Posts: 23
Joined: Sun Dec 23, 2012 11:38 pm

Re: Wrap-around and scrolling support for LCDs

by adafruit_support_mike on Thu May 30, 2013 3:38 pm

Thank you! I'm sure that will get a lot of use.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.

Posts: 44191
Joined: Thu Feb 11, 2010 2:51 pm

Re: Wrap-around and scrolling support for LCDs

by TheSlider on Tue Oct 22, 2013 12:47 pm


Thank you a lot sridhar_rajagopal, this works fine with an lcd screen i recovered from an old printer, it's a 1x16 characters lcd with 14 pins (14x1, no backlight), a VHX1610A.

I initially used this tutorial from Mikey Sklar to wire everything up but used a resistor instead of a potentiometer (no need to adjust) and noticed the lcd didn't display the test correctly as It's considered to be 2 lines of 8 chars just like you (2x8). See here for more info : http://spikenzielabs.com/SpikenzieLabs/LCD_How_To.html

I wish the Adafruit_CharLCD api was updated on github to provide support for these characteristics. Initializing with lcd.begin(16,1) or lcd.begin(8,2) gave the same result (only shows the first 8 chars for each "line").

Note : Please use spaces instead of tabs in the code and be consistent !
Posts: 1
Joined: Tue Oct 22, 2013 12:14 pm

Please be positive and constructive with your questions and comments.