Code: Select all
https://docs.micropython.org/en/latest/pyboard/library/machine.Pin.html
Code: Select all
https://github.com/micropython/micropython/blob/master/docs/library/machine.Pin.rst
Code: Select all
import machine as mc
door = mc.Pin('X1',mc.Pin.IN)
door.irq(handler=None, trigger=(mc.Pin.IRQ_FALLING | mc.Pin.IRQ_RISING),wake=mc.DEEPSLEEP)
Code: Select all
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'DEEPSLEEP'
UPDATE
OK, I see the documentation has not been updated, it should be DEEPSLEEP_RESET, however this results in another error:
Code: Select all
door.irq(handler=None, trigger=(mc.Pin.IRQ_FALLING | mc.Pin.IRQ_RISING),wake=mc.DEEPSLEEP_RESET)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: extra keyword arguments given