How to start PWM fan when pi 4 boots

From Geekworm Wiki
Revision as of 23:47, 25 June 2021 by Harry (talk | contribs) (Created page with "==How to start PWM fan when pi 4 boots)== But we hope that the script can be executed automatically when the Raspberry Pi board boots, we can use crontab system command to ach...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

How to start PWM fan when pi 4 boots)

But we hope that the script can be executed automatically when the Raspberry Pi board boots, we can use crontab system command to achieve it. please refer to the following

sudo crontab -e Choose "1" then press Enter

Add a line at the end of the file that reads like this:

@reboot python /home/pi/fan.py

Please note the path of this file.

Save and exit (CTRK + O and ENTER to save it). In nano editor, you do that by hitting CTRL + X, answering Y and hitting Enter when prompted.