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