Mattfox27
Posts: 10
Joined: Thu Feb 27, 2014 11:51 am

Adafruit LCD won't turn off

Thu Feb 27, 2014 11:56 am

I have setup a Raspberry Pi with a adafruit 16x2 LCD this is my first setup, i have made it display some currency exchange rates in a python script at startup but when i reboot or poweroff the PI the screen stays on and does not reset, whats up with that? Is that normal? The only way to get the LCD to reset is to unplug the PI.

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Adafruit LCD won't turn off

Thu Feb 27, 2014 12:40 pm

Hiu and welcome to the forum.
That is expected operation. The LCD is dumb - it only displays what it is told to do. Also it does not have a reset line, so it does not know that the Pi has been reset unless the software controlling what is displayed tell it to display something else or CLS, for example.
Hope this helps,
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Toxus
Posts: 14
Joined: Tue Nov 19, 2013 12:48 am

Re: Adafruit LCD won't turn off

Thu Feb 27, 2014 10:17 pm

You will maybe want to create an init.d script that runs a script which changes the backlight color to LCD.off (if I remember the Adafruit Python API correctly) which would turn off your LCD. The other workaround is to unplug the power cord when shutting down and then plug it back in to start it back up which will reset the LCD as well. (Please note that your mileage may vary, I'm used a hacked up version of LCDproc and a controller application to run my LCD with backlight colors as well as provide a reset script.)

Mattfox27
Posts: 10
Joined: Thu Feb 27, 2014 11:51 am

Re: Adafruit LCD won't turn off

Fri Feb 28, 2014 1:59 am

Would it be possible to show me how you reset it? This is my first pi and I'm fairly new to it, I have a basic understanding but trying to figure it out. Thanks

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Adafruit LCD won't turn off

Fri Feb 28, 2014 9:28 pm

Looking at the code (I don't have the hardware) I reckon you could do it with:

Code: Select all

from Adafruit_CharLCD import Adafruit_CharLCD

lcd = Adafruid_CharLCD()
lcd.begin(16,1)
lcd.clear()
lcd.write4bits(0x08 | 0x00)
Remember that's not tested.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Mattfox27
Posts: 10
Joined: Thu Feb 27, 2014 11:51 am

Re: Adafruit LCD won't turn off

Fri Feb 28, 2014 11:20 pm

so would i put that into a python script and run it at startup?

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Adafruit LCD won't turn off

Fri Feb 28, 2014 11:59 pm

It's a sample of how you could do it. I'd start by making it a stand-alone script. You can merge it into some other script later.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Beginners”