1、安装python3
# opkg update
# opkg install python3-base
# opkg install python3
# opkg install python3-pip
# opkg install python3-dev
2、安装RPI.GPIO
# pip install rpi.gpio
3、GPIO 控制PWM风扇
### 交互模式演示代码
# python
import RPi.GPIO as GPIO
# GPIO 设置
GPIO.setmode(GPIO.BCM)
GPIO.setup(14,GPIO.OUT)
# 高电平,开风扇
GPIO.output(14,GPIO.HIGH)
# 低电平,关风扇
GPIO.output(14,GPIO.LOW)
# 退出并清理
GPIO.cleanup()
4、系统实时温度查询
# cat /sys/class/thermal/thermal_zone0/temp
标签:树莓,风扇,install,opkg,RPI,GPIO,4b,python3 From: https://www.cnblogs.com/dawnlz/p/18187188