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

Python • Cant get to install rpi-hardware-pwm

$
0
0
Good Day all,

I want to activate and try out hardware pwm on my raspberry pi 5. I followed the instructions given here

https://pypi.org/project/rpi-hardware-pwm/

and made the necessary modification to /boot/firmware/config.txt and saved and rebooted. When I used

Code:

lsmod | grep pwm
It was showing fan and some numerical value. I couldnt get pwm_bcm2835.

Then I tried to install rpi-hardware-pwm using

Code:

sudo pip3 install rpi-hardware-pwm
It said it couldn't find the library to install. I assumed it could be pre installed or updated automatically and tried running this code

Code:

from rpi_hardware_pwm import HardwarePWMpwm = HardwarePWM(pwm_channel=0, hz=60, chip=0)pwm.start(100) # full duty cyclepwm.change_duty_cycle(50)pwm.change_frequency(25_000)pwm.stop()
It gives this error
line 1, in <module> from rpi_hardware_pwm import HardwarePWM

ModuleNotFoundError: No module named 'rpi_hardware_pwm
Could someone tell me what I am doing wrong here. How to install this rpi-hardware-pwm in my Raspberry Pi 5. It is running Raspberry OS with all the updates installed.

Thank you.

Statistics: Posted by sab201 — Wed Sep 18, 2024 7:16 pm



Viewing all articles
Browse latest Browse all 1241

Trending Articles