Skip to content

callback pin/channel compatibility #4

@ArtArt0

Description

@ArtArt0

Hi!

I am using the GPIO.add_event_detect with GPIO.BOARD setting.

The emulator in the callback gives the channel number instead of the pin number.

The documentation sais it is OK, but on the hardware the default GPIO library gives the pin number in this case!

The old code:
GPIO.add_event_detect(PINS.BUTTON, GPIO.BOTH, callback=waitOnEvent)
which gives the parameter like channel.

I use the folowing workaround:
GPIO.add_event_detect(PINS.BUTTON, GPIO.BOTH, callback=lambda x: waitOnEvent(PINS.BUTTON))
which gives the parameter like pin (PINS.BUTTON)

I dont know it is a problem or not, but definitely a compatible issue...

Regards, Art

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions