Code:
from machine import Pinimport asyncioasync def callback(p): print(f'pin change {p}')async def main(): p0 = Pin(20, Pin.IN) p0.irq(trigger=Pin.IRQ_RISING | Pin.IRQ_FALLING, handler=await callback(p0)) while True: print("Still in main") await asyncio.sleep_ms(1000)asyncio.run(main())
Statistics: Posted by jujiro — Sun Feb 16, 2025 9:08 pm — Replies 0 — Views 27