Page 1 of 1

Adafruit LCD won't turn off

Posted: Thu Feb 27, 2014 11:56 am
by Mattfox27
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.

Re: Adafruit LCD won't turn off

Posted: Thu Feb 27, 2014 12:40 pm
by texy
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

Re: Adafruit LCD won't turn off

Posted: Thu Feb 27, 2014 10:17 pm
by Toxus
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.)

Re: Adafruit LCD won't turn off

Posted: Fri Feb 28, 2014 1:59 am
by Mattfox27
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

Re: Adafruit LCD won't turn off

Posted: Fri Feb 28, 2014 9:28 pm
by DougieLawson
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.

Re: Adafruit LCD won't turn off

Posted: Fri Feb 28, 2014 11:20 pm
by Mattfox27
so would i put that into a python script and run it at startup?

Re: Adafruit LCD won't turn off

Posted: Fri Feb 28, 2014 11:59 pm
by DougieLawson
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.