MicroPython/RP2350ZERO/main.py

14 lines
224 B
Python

import utime
from machine import Pin
from utils import MTS102
# 配置引脚
led = Pin(0, Pin.OUT)
toggle_switch = MTS102(1)
while True:
if toggle_switch.switched:
led.on()
else:
led.off()
utime.sleep_ms(200)