This commit is contained in:
xyj 2023-12-26 17:12:04 +08:00
parent 1befe16519
commit 96a9384e29
1 changed files with 10 additions and 9 deletions

View File

@ -4,14 +4,15 @@
'''
import time
#导入相关模块
# 导入相关模块
import board
from digitalio import DigitalInOut, Direction
#构建LED对象和初始化
led = DigitalInOut(board.LED) #定义引脚编号
led.direction = Direction.OUTPUT #IO为输出
led.value = 1 #输出高电平点亮板载LED蓝灯
time.sleep(10)
led.value = 0 #输出低电平熄灭板载LED蓝灯
# 构建LED对象和初始化
led = DigitalInOut(board.CS1) # 定义引脚编号
led.direction = Direction.OUTPUT # IO为输出
while True:
print("熄灭")
led.value = 0 # 输出低电平熄灭板载LED蓝灯
print("点亮")
time.sleep(5)
led.value = 1 # 输出高电平点亮板载LED蓝灯