{"repo":"Pioreactor/rpi_hardware_pwm","free":true,"listed":false,"github":"https://github.com/Pioreactor/rpi_hardware_pwm","clone":"git clone https://github.com/Pioreactor/rpi_hardware_pwm.git","description":"Access the hardware PWM of a Raspberry Pi","language":"Python","stars":108,"topics":["raspberry-pi","gpio","raspberrypi","hardware","python"],"license":null,"category":"self-hosted-apps","readme_excerpt":"rpi hardware pwm Access the hardware PWM of a Raspberry Pi with Python. More lightweight than alternatives. Installation 1. On the Raspberry Pi, add dtoverlay=pwm-2chan to /boot/firmware/config.txt . This defaults to GPIO 18 as the pin for PWM0 and GPIO 19 as the pin for PWM1 . - Alternatively, you can change GPIO 18 to GPIO 12 and GPIO 19 to GPIO 13 using dtoverlay=pwm-2chan,pin=12,func=4,pin2=13,func2=4 . - On the Pi 5, use channels 0 and 1 to control GPIO 12 and GPIO13, respectively; use channels 2 and 3 to control GPIO 18 and GPIO 19, respectively - On all other models, use channels 0 and 1 to control GPIO-18 and GPIO 19, respectively 2. Reboot your Raspberry Pi . - You can check everything is working on running lsmod grep pwm and looking for pwm bcm2835 3. Install this library: sudo pip3 install rpi-hardware-pwm Examples History The original code is from jdimpson/syspwm, We've updated it to Python3 and made it look like the RPi.GPIO library's API (but more Pythonic than that.), and we use it in Pioreactor bioreactor system.","default_branch":null,"files":null,"tree":[],"storefront":"/r/Pioreactor","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Pioreactor/rpi_hardware_pwm/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}