Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
irq not work
#1

Hi,

The interruption/callback does not work for me...


def callback(p):
    print('pin change', p)





p0 = machine.Pin(0, machine.Pin.IN, machine.Pin.PULL_UP, handler=callback('p0'), trigger=machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)


During start, the function starts once "callback()"


The Prog button (Pin 0) does not respond to
callback function.

Reply
#2
You need to use handler=callback without the parenthesis. With the parenthesis you’re setting handler to the return value of calling the callback.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)