Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5114

Troubleshooting • Re: Hardware PWM not working with Raspberry Pi 5 4GB

$
0
0
This is just a test code:

Code:

from rpi_hardware_pwm import HardwarePWMimport timepwm = HardwarePWM(pwm_channel=0, hz=60, chip=2)pwm.start(100) # full duty cycletime.sleep(1)pwm.change_duty_cycle(50)time.sleep(1)pwm.change_duty_cycle(100)pwm.stop()
No errors, but there is no change in duty cycle. It stays at 100 all the time.
It controls screen brightness and there is no change in that.
Hmm, why can't you simply setup the PWM as a backlight and then use the kernel driver for changing brightness (My expectation is you don't do that that frequent)?
Could you give some hints how to do that? I'm happy to learn more about the subject.

Using the Python library was just easiest choice for me.
I created an automatic screen brightness control with a light sensor.

Statistics: Posted by valtsu23 — Mon Mar 04, 2024 2:51 pm



Viewing all articles
Browse latest Browse all 5114

Trending Articles