update
This commit is contained in:
parent
1befe16519
commit
96a9384e29
11
test_led.py
11
test_led.py
|
@ -7,11 +7,12 @@ import time
|
|||
# 导入相关模块
|
||||
import board
|
||||
from digitalio import DigitalInOut, Direction
|
||||
|
||||
# 构建LED对象和初始化
|
||||
led = DigitalInOut(board.LED) #定义引脚编号
|
||||
led = DigitalInOut(board.CS1) # 定义引脚编号
|
||||
led.direction = Direction.OUTPUT # IO为输出
|
||||
|
||||
led.value = 1 #输出高电平,点亮板载LED蓝灯
|
||||
time.sleep(10)
|
||||
while True:
|
||||
print("熄灭")
|
||||
led.value = 0 # 输出低电平,熄灭板载LED蓝灯
|
||||
print("点亮")
|
||||
time.sleep(5)
|
||||
led.value = 1 # 输出高电平,点亮板载LED蓝灯
|
||||
|
|
Loading…
Reference in New Issue