sample code for interrupts from the documentation:
http://micropython.org/resources/docs/e ... e.Pin.html
Code: Select all
from machine import Pin
def pincb(pin):
print(pin.id())
pin_int = Pin('GP10', mode=Pin.IN, pull=Pin.PULL_DOWN)
pin_int.irq(mode=Pin.IRQ_RISING, handler=pincb)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: argument num/types mismatch
Shouldn't it be 'trigger=Pin.IRQ_RISING' instead of 'mode=Pin.IRQ_RISING'
However - I can not get the code to run properly. When triggering the Input the Heartbeard LED is
flashing rapidly to signal there was an Error - but I do not get any traceback, nothing. Please Help...