-->
Page 1 of 1

Interrupt Example

PostPosted: Tue Mar 31, 2015 12:52 pm
by gerardwr
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

Re: Interrupt Example

PostPosted: Sat Apr 04, 2015 10:47 am
by alain 06640
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

Re: Interrupt Example

PostPosted: Sat Apr 04, 2015 12:10 pm
by gerardwr
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 !