Are you an LLM? You can read better optimized documentation at /public/embedded\raspberrypi-pico\micropython\chapter03\index.md for this page in Markdown format
3. 检测按键
python
from machine import Pin
import utime
key = Pin(16, Pin.IN)
while True:
print(key.value())
utime.sleep(1)