update
This commit is contained in:
parent
59d763e5f4
commit
abc45cef40
|
@ -0,0 +1,2 @@
|
||||||
|
import board
|
||||||
|
print(board.CS1)
|
10
close_led.py
10
close_led.py
|
@ -1,5 +1,5 @@
|
||||||
'''
|
'''
|
||||||
实验名称:点亮第1个LED
|
实验名称:熄灭第1个LED
|
||||||
实验平台:核桃派
|
实验平台:核桃派
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
@ -12,9 +12,7 @@ if __name__ == '__main__':
|
||||||
# 构建LED对象和初始化
|
# 构建LED对象和初始化
|
||||||
led = DigitalInOut(board) # 定义引脚编号
|
led = DigitalInOut(board) # 定义引脚编号
|
||||||
led.direction = Direction.OUTPUT # IO为输出
|
led.direction = Direction.OUTPUT # IO为输出
|
||||||
|
led.value = 0 #输出低电平,熄灭板载LED蓝灯
|
||||||
led.value = 1 # 输出高电平,点亮板载LED蓝灯
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
# led.value = 0 #输出低电平,熄灭板载LED蓝灯
|
|
||||||
except:
|
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
'''
|
||||||
|
实验名称:点亮第1个LED
|
||||||
|
实验平台:核桃派
|
||||||
|
'''
|
||||||
|
|
||||||
|
# 导入相关模块
|
||||||
|
import board
|
||||||
|
from digitalio import DigitalInOut, Direction
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
try:
|
||||||
|
# 构建LED对象和初始化
|
||||||
|
led = DigitalInOut(board) # 定义引脚编号
|
||||||
|
led.direction = Direction.OUTPUT # IO为输出
|
||||||
|
led.value = 1 # 输出高电平,点亮板载LED蓝灯
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
pass
|
Loading…
Reference in New Issue