2023-12-23 11:52:43 +08:00
|
|
|
|
'''
|
2023-12-25 09:36:37 +08:00
|
|
|
|
实验名称:熄灭第1个LED
|
2023-12-23 11:52:43 +08:00
|
|
|
|
实验平台:核桃派
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
#导入相关模块
|
|
|
|
|
import board
|
|
|
|
|
from digitalio import DigitalInOut, Direction
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
# 构建LED对象和初始化
|
2023-12-25 15:30:15 +08:00
|
|
|
|
led = DigitalInOut(board.CS1) # 定义引脚编号
|
2023-12-23 11:52:43 +08:00
|
|
|
|
led.direction = Direction.OUTPUT # IO为输出
|
2023-12-26 17:40:11 +08:00
|
|
|
|
led.value = 1 #输出低电平,熄灭板载LED蓝灯
|
2023-12-25 09:36:37 +08:00
|
|
|
|
except Exception as e:
|
2023-12-23 11:52:43 +08:00
|
|
|
|
pass
|