python-liquidcrystal_i2c icon indicating copy to clipboard operation
python-liquidcrystal_i2c copied to clipboard

How to turn backlight off!!

Open kernelkim opened this issue 9 years ago • 5 comments

I wanto to control backlight. This code turns on always. So I try to change it in the code. but It doesn't work. Just blinking.

kernelkim avatar Nov 17 '16 04:11 kernelkim

Hi kernelkim,

I added the methods noBacklight() and backlight().

Can you test if it works for you?

Cheers, Patrick

pl31 avatar Nov 20 '16 20:11 pl31

Thank you for updating!! But after turn off backlight, when I write text to lcd, LCD's backlight turns on. Finally backlight always turned on always.

kernelkim avatar Nov 21 '16 06:11 kernelkim

Hi kernelkim,

Using the example I could reproduce the behaviour you described.

import liquidcrystal_i2c
import time

cols = 20
rows = 4

lcd = liquidcrystal_i2c.LiquidCrystal_I2C(0x27, 1, numlines=rows)

# turn off backlight
lcd.noBacklight()
time.sleep(1)

# writing to display turns backlight on again
lcd.printline(0, 'LCM2004 IIC V2'.center(cols))
lcd.printline(1, 'and'.center(cols))
lcd.printline(2, 'python-')
lcd.printline(3, 'liquidcrystal_i2c'.rjust(cols))

I checked the code, but it seems to be a "feature" of the display :(. No idea how to fix that. Sorry.

Cheers, Patrick

pl31 avatar Dec 04 '16 17:12 pl31

Thank you!! I have a C code to control this LCD. but in this code, LCD is working correctly. Anyway, Thanks.

kernelkim avatar Dec 05 '16 04:12 kernelkim

If it works in C it should work here, too. If you could give me a link to the C-Code, I'd give it another try.

Cheers, Patrick

pl31 avatar Dec 05 '16 16:12 pl31