(只需单色灯显示的客户. 直接参看 步骤 2 , 此步骤1直接忽略)
wiringPi
sudo apt-get install wiringpi
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
gpio -v
#会看到gpio version: 2.52,说明安装成功
Python
sudo apt-get update
sudo apt-get install python-pip
sudo pip3 install RPi.GPIO
跳线帽设置如下:
R接GND(其他灯不接悬空) 红灯亮
G B 灯亮同样跳线方法
跳线帽设置如下:
之后运行程序:
wget http://spotpear.cn/public/uploads/picture/learn/raspberry-pi/rpi-expansion/raspberry-pi-fan-hat/led_rgb.py
sudo python led_rgb.py
现象:三色LED依次由亮到灭