Comments on: ESP32 GPIO Interrupts with Arduino IDE https://randomnerdtutorials.com/esp32-gpio-interrupts-arduino/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Wed, 28 Jan 2026 11:59:40 +0000 hourly 1 https://wordpress.org/?v=6.8.5 By: Pippo https://randomnerdtutorials.com/esp32-gpio-interrupts-arduino/#comment-1117399 Sat, 01 Nov 2025 14:47:26 +0000 https://randomnerdtutorials.com/?p=181571#comment-1117399 In reply to Sara Santos.

Thank you for the thorough clarification and, as always, for your availability. Cheers.

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-gpio-interrupts-arduino/#comment-1117351 Sat, 01 Nov 2025 11:28:22 +0000 https://randomnerdtutorials.com/?p=181571#comment-1117351 In reply to Pippo.

Hi.
The IRAM_ATTR is the notation used by espressif.
ARDUINO_ISR_ATTR is the equivalent to be used in Arduino IDE, it’s the Arduino-ESP32 core wrapper. Both can work with Arduino IDE, like many other espressif functions without using the equivalent for Arduino IDE.

Regards,
Sara

]]>
By: Pippo https://randomnerdtutorials.com/esp32-gpio-interrupts-arduino/#comment-1117283 Sat, 01 Nov 2025 06:25:29 +0000 https://randomnerdtutorials.com/?p=181571#comment-1117283 Hello everyone, congratulations on your work. I’ve been following RN for a while and have always enjoyed your articles. Like others, I also use the ESP32 module in several projects. I use Arduino IDE 2.3.7-nightly-20250705 together with ESP32 Espressif System 2.0.17. In some of my projects, I use INTERRUPTs, but they are declared as – IRAM_ATTR – and the compiler (set to VERBOSE) doesn’t report errors. In this article, however, you use – ARDUINO_ISR_ATTR -. What did I miss?

]]>
By: Steve Platt https://randomnerdtutorials.com/esp32-gpio-interrupts-arduino/#comment-1117009 Fri, 31 Oct 2025 11:49:32 +0000 https://randomnerdtutorials.com/?p=181571#comment-1117009 In the first button example, the pin is set to INPUT_PULLUP. The button itself will short the pin to GND. When the button is open (not pressed), the pin reads HIGH; when pressed, LOW.
So, should the call to attachInterrupt use FALLING instead of RISING, or is the intent that it triggers on the button’s release?

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-gpio-interrupts-arduino/#comment-1116994 Fri, 31 Oct 2025 10:31:53 +0000 https://randomnerdtutorials.com/?p=181571#comment-1116994 In reply to Ray Leiter.

Hi.
Thanks for letting me know.
I fixed it now.

It should be working as expected.

Regards,

Sara

]]>
By: Josif https://randomnerdtutorials.com/esp32-gpio-interrupts-arduino/#comment-1116992 Fri, 31 Oct 2025 10:31:16 +0000 https://randomnerdtutorials.com/?p=181571#comment-1116992 You should rewire the button circuit with an appropriate pull-down resistor and button connected to Vcc to match the code (and the described behavior).

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-gpio-interrupts-arduino/#comment-1116989 Fri, 31 Oct 2025 10:27:21 +0000 https://randomnerdtutorials.com/?p=181571#comment-1116989 In reply to Gabryx.

Hi.
You can use FreeRTOS to define priorities for your tasks.
I need to take a look into that.
Regards,
Sara

]]>
By: Ray Leiter https://randomnerdtutorials.com/esp32-gpio-interrupts-arduino/#comment-1116845 Thu, 30 Oct 2025 23:49:52 +0000 https://randomnerdtutorials.com/?p=181571#comment-1116845 This link is broke!
https://randomnerdtutorials.com/esp32-gpio-interrupts-arduino/#example-1

]]>
By: Gabryx https://randomnerdtutorials.com/esp32-gpio-interrupts-arduino/#comment-1116715 Thu, 30 Oct 2025 17:17:12 +0000 https://randomnerdtutorials.com/?p=181571#comment-1116715 It would be nice to have a more in-depth look at interrupts and how to assign priorities (1-3 with C++ code and 4-7 in assembler) because there aren’t many explanations available.
To read a keystroke (which is the case with the example in this article), these default routines are fine, but to read the frequency response of an LC circuit, for example, you need maximum precision.
I’m about to finish an inductance reader based on the Colpitt oscillator, and I’ve noticed that using GPIO D4 gives me better results… perhaps because it has a higher default priority than other GPIOs?
D4 is enabled by default for touch reading.
Bye

]]>