Skip to content

Commit

Permalink
按键逻辑控制点灯
Browse files Browse the repository at this point in the history
  • Loading branch information
yangkun5330 authored Nov 5, 2022
1 parent a0acb1c commit a6024d9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions 按键逻辑控制点灯.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from machine import Pin
import time

led=Pin(0,Pin.OUT)
switch=Pin(1,Pin.IN,Pin.PULL_UP)

while True:
if switch.value()==0:
led.value(1)
else:
led.value(0)

0 comments on commit a6024d9

Please sign in to comment.