Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5288

General • Re: RP2040: multiple (6) GPIO interrupts

$
0
0
Too vague. Kinda like bait. I'm not going to touch this one.
:?:

Seems a reasonable request to me - Six inputs, so how do I have six interrupt routines to handle each of those separately -- presumably for rising or falling edges.

I have no idea if the OP is using C or other compiled language, but for MicroPython it is trivially easy -

Code:

def switch0_irq_handler(self):  print("Switch 0 Activated")  switch0 = Pin(0, Pin.IN, Pin.PULL_DOWN)switch0.irq(trigger=Pin.IRQ_RISING, handler=switch0_irq_handler)
Duplicate as many times as needed.

Statistics: Posted by hippy — Sun Aug 04, 2024 3:51 pm



Viewing all articles
Browse latest Browse all 5288

Trending Articles