I am using the Pressed example for the EasyButton library. It is not ESP32 specific but works for my AdaFruit Feather ESP32 board.
It does not compile and throws the following compilation errors:
In file included from /Users/jjs/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/cores/esp32/Arduino.h:223,
from /private/var/folders/6v/1p1396h55_72kp8gnv3gsnv00000gq/T/arduino/sketches/9AF4919C475D15D2FB9CC92B2D1DAFB4/sketch/Pressed-Nano-ESP32.ino.cpp:1:
/Users/jjs/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/cores/esp32/io_pin_remap.h:44:69: error: variable or field 'attachInterrupt' declared void
#define attachInterrupt(pin, fcn, mode) attachInterrupt(digitalPinToGPIONumber(pin), fcn, mode)
^~~~~~~~~~~~~~~~~~~~~~
/Users/jjs/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/cores/esp32/FunctionalInterrupt.h:18:6: note: in expansion of macro 'attachInterrupt'
void attachInterrupt(uint8_t pin, std::function<void(void)> intRoutine, int mode);
^~~~~~~~~~~~~~~
/Users/jjs/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/cores/esp32/FunctionalInterrupt.h:18:30: error: expected primary-expression before 'pin'
void attachInterrupt(uint8_t pin, std::function<void(void)> intRoutine, int mode);
^~~
/Users/jjs/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/cores/esp32/io_pin_remap.h:44:92: note: in definition of macro 'attachInterrupt'
#define attachInterrupt(pin, fcn, mode) attachInterrupt(digitalPinToGPIONumber(pin), fcn, mode)
^~~
/Users/jjs/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/cores/esp32/FunctionalInterrupt.h:18:61: error: expected primary-expression before 'intRoutine'
void attachInterrupt(uint8_t pin, std::function<void(void)> intRoutine, int mode);
^~~~~~~~~~
/Users/jjs/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/cores/esp32/io_pin_remap.h:44:98: note: in definition of macro 'attachInterrupt'
#define attachInterrupt(pin, fcn, mode) attachInterrupt(digitalPinToGPIONumber(pin), fcn, mode)
^~~
/Users/jjs/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/cores/esp32/FunctionalInterrupt.h:18:73: error: expected primary-expression before 'int'
void attachInterrupt(uint8_t pin, std::function<void(void)> intRoutine, int mode);
^~~
/Users/jjs/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/cores/esp32/io_pin_remap.h:44:103: note: in definition of macro 'attachInterrupt'
#define attachInterrupt(pin, fcn, mode) attachInterrupt(digitalPinToGPIONumber(pin), fcn, mode)
^~~~
exit status 1
Compilation error: exit status 1
I will raise an issue on the EasyButton github page: GitHub - evert-arias/EasyButton: Arduino library for debouncing momentary contact switches, detect press, release, long press and sequences with event definitions and callbacks.
Anyone with similar experiences? Any workarounds?
Using Arduino 2.1.1 on a Mac. Board setting is Arduino Nano ESP32