Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By gerardwr
#13123 The sketch is a working example to show the use of interrupts.

Each time the level from GPIO0 changes from HIGH to LOW the main loop (that prints the value of a variable) in interrupted and the value of the variable inverted.

The picture below shows the output from the sketch.

Schermafbeelding 2015-03-31 om 19.48.41.png


ESP_interrupt2.ino.zip
You do not have the required permissions to view the files attached to this post.
Last edited by gerardwr on Sat Apr 04, 2015 12:04 pm, edited 1 time in total.
User avatar
By alain 06640
#13464 Hello,
I think that there is something missing in your example related to led_pin. I suppose that it is an external led connected to GPIO2 ?
I commented the digitalWrite and the interrupt works fine.
Alain
User avatar
By gerardwr
#13473
alain 06640 wrote:Hello,
I think that there is something missing in your example related to led_pin. I suppose that it is an external led connected to GPIO2 ?
I commented the digitalWrite and the interrupt works fine.
Alain


You're absolutely right Alain.

For the example I removed some code to make the example as simple as possible.

I accidentally left a "digitalwrite" line for an external LED, and it caused a compile error.

I removed the line in the original post now, so it compiles OK.

Thanks for reporting it !