pl31/python-liquidcrystal_i2c

How to turn backlight off!!

kernelkim opened this issue · 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.

pl31 commented

Hi kernelkim,

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

Can you test if it works for you?

Cheers,
Patrick

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.

pl31 commented

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

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

pl31 commented

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