Pin interrupts are done via pin.callback(trigger, handler=None, arg=None) Check the Pin manual for details https://docs.pycom.io/pycom_esp32/library/machine.Pin.html