Coder Social home page Coder Social logo

Comments (7)

thijstriemstra avatar thijstriemstra commented on September 28, 2024

same happening with hd44780.

from luma.lcd.

Kyuchumimo avatar Kyuchumimo commented on September 28, 2024

Using active_low=False as a parameter for the device object, makes the device.backlight(True) function turn the lights on and GPIO.input(18) returns 1. By default active_low parameter is always in boolean condition as True as long as it is not provided by the programmer.

device = pcd8544(serial, active_low=False)

device.backlight(True)

active low in electronics means a pin plugged to ground for enable a function (In this case, the backlight), and an active high is a pin plugged to 5V or 3.3V for enable a function (In this case, the backlight).
In this case, the backlight pin is an active high, since to turn on, a voltage needs to be supplied

From what I see this is normal. I suppose that for all LCD screens the backlight pin will not always be active low, as is the case with pcd8544 and hd44780 (without i2c backpack)

Please confirm if this is the case.

from luma.lcd.

thijstriemstra avatar thijstriemstra commented on September 28, 2024

Please confirm if this is the case.

Not sure what you want me to confirm, but my hd44780 is connected to gpio pin 27, causing the backlight to be enabled all the time unless I call backlight(True).

self.display = hd44780(self.interface, width=20, height=4, gpio_LIGHT=27)

from luma.lcd.

Kyuchumimo avatar Kyuchumimo commented on September 28, 2024

@thijstriemstra
This is not how the backlight function works, backlight(True) should turn on the LED, not turn it off

see: https://luma-lcd.readthedocs.io/en/latest/python-usage.html#backlight-control
"The backlight can be programmatically switched on and off by calling device.backlight(True) or device.backlight(False) respectively."

from luma.lcd.

thijstriemstra avatar thijstriemstra commented on September 28, 2024

backlight(True) disables the backlight, which is incorrect imo, sorry if I wasn't clear. I would expect it the other way around like the docs state.

from luma.lcd.

Kyuchumimo avatar Kyuchumimo commented on September 28, 2024

@thijstriemstra Wait, this is not a bug, it is something expected. Haven't you read what I said?. The only thing I think is that active_low should be False by default by the luma.lcd library, since the backlight pin, which is almost always a positive pin leading to an LED must be active high for it to turn on

https://www.petervis.com/dictionary-of-digital-terms/what-does-active-low-mean/what-does-active-low-mean.html

from luma.lcd.

Kyuchumimo avatar Kyuchumimo commented on September 28, 2024

Tested on ST7735 with same behavior: device.backlight(False) makes turn on backlight LED

from luma.lcd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.