It's OK to use Raspberry Pi to light up the LED

Insert picture description here
First, download a gpio library

pip3 install gpiozero
touch /home/pi/Desktop/gpio.py
然后使用 vim 来编辑他

from gpiozero import LED
from time import sleep

led1 = led(20)

while True:
	led1.on()
	sleep(1)
	led1.off()
	sleep(1)
python3 gpio.py

Insert picture description here

Guess you like

Origin blog.csdn.net/helloworld573/article/details/105716604