nebhead / PiFire

PiFire is a Smart WiFi enabled controller for your pellet smoker / grill.
https://nebhead.github.io/PiFire-Pages
MIT License
82 stars 31 forks source link

Use hardware PWM generator for PiFire PWM PCB grill platform #158

Closed ghandye closed 1 year ago

ghandye commented 1 year ago

Updates the PWM implementation for the PiFire PWM PCB grill platform to use the built-in hardware PWM generator on the Raspberry Pi SoC. This resolves https://github.com/nebhead/PiFire/issues/156.

Previous implementation used gpiozero software PWM; this implementation uses rpi_hardware_pwm library.

This is a breaking commit, as the hardware PWM function requires:

1) Installing the rpi-hardware-pwm library

sudo pip install rpi-hardware-pwm

2) Adding this line to the end of /boot/config.txt, and rebooting:

dtoverlay=pwm,pin=13,func=4

Once these two changes are done, this commit will enable hardware PWM.