From 96a9384e290691b0dc08d15efb2c9500984a96cf Mon Sep 17 00:00:00 2001 From: xyj <10908227994@qq.com> Date: Tue, 26 Dec 2023 17:12:04 +0800 Subject: [PATCH] update --- test_led.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/test_led.py b/test_led.py index c194246..164ccdf 100644 --- a/test_led.py +++ b/test_led.py @@ -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蓝灯 \ No newline at end of file +# 构建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蓝灯