Grove 16x2 LCD Raspberry Backlight

Hello,
I just started my adventure with Raspberry and Grove Base Hat. I’m using python library (from grove.display.jhd1802 import JHD1802) and it works great but backlight is always turn on. I want the backlight turn on only when I program it. It is possible?

Hi @AndrzejLanc
You can use lcd.backlight(False) to close the backlight after you programmed it.

Hi @jiachenglu

That’s my code:

from time import sleep
from grove.display.jhd1802 import JHD1802

def main():
lcd = JHD1802()

while True:
    lcd.clear()
    lcd.backlight(True)
    lcd.write("backlight true")
    sleep(0.5)
    lcd.setCursor(0, 0)
    lcd.backlight(False)
    lcd.write("backlight false")
    sleep(0.5)

if name == ‘main’:
main()


Why it doesn’t turn off the backlight?