Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ESP8266 Pin Get Physical Address #7831

Open
@PsuFan

Description

@PsuFan

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions