QUERY · ISSUE
ESP8266 Pin Get Physical Address
port-esp8266
Is there a way to get the physical address of a pin class? For example a IRQ pin handler, determine which pin has tripped?
from machine import Pin
def handle(p):
print(int(str(p)[4:-1])) # Better way to get pin number 5?
pin = Pin(5, Pin.IN, Pin.PULL_UP)
pin.irq(trigger=Pin.IRQ_FALLING, handler=handle)
CANDIDATE · ISSUE
ESP8266 get pin id once set
port-esp8266
Is there a clean way to access the pin id having a Pin object?
>>> from machine import Pin
>>> p = Pin(4)
>>> p.id() # Something like this
4
Thanks