adafruit / adafruit/Adafruit_CircuitPython_Qualia
Allow PWM control of display brightness
- Dominant language
- Python
- Stars
- 3
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
`peripherals.brightness` (`board.BACKLIGHT` on the PCA9554 I/O expander) is enabled as an output on startup, and is set originally to `True`. Setting it to False leaves it as an output.
If the A1/PWM jumper is soldered closed, the code above prevents PWM output on `board.A1` from adjusting the brightness, because the output current can override the PWM output.
If board.BACKLIGHT` on the PCA9554 is set to an input, then it has two weaker pullups on it: one is a 10k resistor on the board, and the other is the built-in pullup on the PCA9554.
This can be done in a hacky way by doing `peripherals._backlight.switch_to_input(pull=Pull.UP)`. But it would be better to have it in the API.
How about allowing `peripherals.backlight = None`? This would do a `switch_to_input()` as above. If the jumper is solder closed, then this has been shown to allow PWM-ing the brightness. The API documentation should explain this and explain that the jumper must be soldered closed.
There _could_ also be an API added to do the PWM-ing.
See https://discord.com/channels/327254708534116352/537365702651150357/1439017635697262735 and below (and a little above).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the peripherals.backlight API and its board.BACKLIGHT handling on the PCA9554. Confirm whether the intended scope is accepting None, adding PWM control, or both; done should include the selected behavior and API documentation explaining the A1/PWM jumper requirement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100