dhalbert · GitHub

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).

Read the original on github.com ↗