"from machine import Pin[/align]value=1
if(value == 0):
value = 1
value = 0
led = Pin(14, Pin.OUT)
button = Pin(0, Pin.IN)
I don’t need the compiling environment of how to find port no. and how to enter esp8266 micropython. Refer to the previously published documents if you don’t understand. As shown below, after entering the compiling environment, paste our interrupt program according to the said method.
Press Ctrl+d to complete pasting and then run the program. Now it output <IRQ>, which means our program is good and is under execution. At this time, we can see that led light is in extinguished state on our esp8266 development board.
We connect a DuPont line to GPIO0 port of the board. Touch other pins with the other end of the DuPont line. There will be result as shown below. Every time of touch, led light will flash for one time, and counter number will increase. Therefore, we realize the effect of interruption.