Is there a non-polling way to detect when an input goes from OFF to ON with the Raspberry Pi Pico MicroController?
I see the Raspberry Pi allows one to do something like below to detect rising edges on a GPIO port (reference: https://forums.raspberrypi.com/viewtopic.php?t=184361):
import RPi.GPIO as GPIO
GPIO.add_event_detect(<pin number>, GPIO.RISING, callback=<callback>)
Is there a similar API available for the Pico? When I try the above on Thonny/Pico, it fails because it doesn't recognize the GPIO module.
global variables , increments with each interrupt
counter_1 = 0 counter_2 = 0
declare pins for leds
red_led = Pin(20, mode = Pin.OUT, value = 0) yellow_led = Pin(21, mode = Pin.OUT, value = 0)
declare pins for monitoring interrupts using push buttons
*core_1_interrupt_pin = Pin(16,Pin.IN,Pin.PULL_DOWN)* *core_2_interrupt_pin = Pin(15,Pin.IN,Pin.PULL_DOWN)*
– tlfong01 Oct 24 '22 at 08:22irqcall, thanks! – Vivek Oct 26 '22 at 13:30