I am not sure if I do something wrong.
I got a lolin esp8266 V3 (tried two boards)and compiled the latest firmware "MicroPython v1.11-167-g331c224e0-dirty on 2019-07-21; ESP module with ESP8266"
The code below reboots the board
Code: Select all
from time import sleep, sleep_ms from machine import Pin, I2C, disable_irq, enable_irq, Timer my_inter = False def callback(pin): global my_inter my_inter = True p_irq = Pin(13, Pin.IN) # create input pin on GPIO13 p_irq.irq(trigger=Pin.IRQ_RISING, handler=callback) state = disable_irq() sleep_ms(4000) print("after state = disable_irq()") enable_irq(state) print("after enable_irq(state)")
as long as I keep the sleep periode not longer than 3.5 secs it seems to work once but reboots on consecutive calls
Thank you for your advice and help