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
Pin Interrupts don't appear to take keyword arguments
port-esp8266
Documentation for esp at http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/pins.html
reads
>>> p0.irq(trigger=Pin.IRQ_FALLING, handler=callback)
>>> p2.irq(trigger=Pin.IRQ_RISING | Pin.IRQ_FALLING, handler=callback)
However, the irq method doesn't take keyword arguments but works fine with positional arguments.