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

Interfacing (DSI, CSI, I2C, etc.) • Re: How to get hardware PWM working on pi 5?

$
0
0
Hey all,
been busy recently and haven't jumped into the forums recently. But in terms of getting hardware-pwm working,

It Works!

I figured this out by replacing the motor with an LED and noticing it turned on everytime I ran the hardware pwm script. The issue with the motor was the pwm.change_duty_cycle() was set to some high number. The servo moved when the value was set somewhere from 4 to 9.
Another thing to point out is that if you do run a gpiozero script on these pins and then try to use the hardware pwm script again, it raises an error, which can easily be fixed if the pins are reset to hardware gpio pins using pinctrl to change the state of the gpio pins from output to hardware.

As for the images above, it was because I screenshoted it from my pc using the pi connect website to VNC onto the pi 5.

Statistics: Posted by JohnAnton1 — Tue Aug 20, 2024 11:03 pm



Viewing all articles
Browse latest Browse all 3862

Trending Articles