Dual pin assignment

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
wonde05
Posts: 26
Joined: Thu Apr 08, 2021 12:53 pm

Dual pin assignment

Post by wonde05 » Sat Feb 12, 2022 12:40 pm

Hi guys, I was working with esp 32 and I was wondering if its possible to use the same pin to wake the esp32 from light sleep and also as an interrupt key ?

Code: Select all

from machine import Pin
import esp32

esp32.wake_on_ext0(Pin(4), esp32.WAKEUP_ANY_HIGH)
pir = Pin(4, Pin.IN)
pir.irq(trigger = Pin.IRQ_RISING, handler = handle_interrupt)

Post Reply