So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By parijip
#84642 I am trying to interrupt a ESP8266 nodemcu using the interrupt from ADXL345. I know that the interrupt is being raised - as a function call to read the interrupt in the loop does get to it - however, the ISR registered against that interrupt fails to get called and set the global variable - which the beginning of the loop fails to read... Attached the sketch for your reference...
You do not have the required permissions to view the files attached to this post.
User avatar
By Anttiduino
#84651 I don't know how it goes with ESP8266 but in many environments it is a bad idea to change variable values in an interrupt. But defining the variable "volatile" may help:

volatile uint8_t intSrc = 0; // The interrupt source is read into this

See e.g. this
User avatar
By parijip
#84653 Thanks a lot for your reply.

Anttiduino wrote:volatile uint8_t intSrc = 0; // The interrupt source is read into this


Added the "volatile" qualifier in the sketch. However, that did not make any difference.