evert-arias / EasyButton

Arduino library for debouncing momentary contact switches, detect press, release, long press and sequences with event definitions and callbacks.
https://easybtn.earias.me
MIT License
453 stars 63 forks source link

Compile errors in MultipleButtons.ino #21

Closed vazquezjm closed 5 years ago

vazquezjm commented 5 years ago

HI @evert-arias !

I'm getting the following error when compiling the example MultipleButtons.ino

\Arduino\libraries\EasyButton\src\EasyButton.cpp: In member function 'void EasyButton::enableInterrupt(EasyButton::callback_t)':

\Arduino\libraries\EasyButton\src\EasyButton.cpp:174:63: error: cannot convert 'EasyButton::callback_t {aka std::function<void()>}' to 'void (*)()' for argument '2' to 'void attachInterrupt(uint8_t, void (*)(), int)'

  attachInterrupt(digitalPinToInterrupt(_pin), callback, CHANGE);

                                                               ^
exit status 1
Error compiling for board LOLIN(WEMOS) D1 R2 & mini.

This happens both in Arduino IDE v1.8.9 and PlatformIO (VSC)

elC0mpa commented 5 years ago

@vazquezjm thanks for inform us about this issue. We are working on it, it will be fixed in the Next release, wich will be ready soon

evert-arias commented 5 years ago

Hi @vazquezjm This issue has been fixed https://github.com/evert-arias/EasyButton/commit/fed0ad89c017bb470ac818d4f93ec8c3a5f84b8a and a new release it's now available to download. https://github.com/evert-arias/EasyButton/releases/tag/v1.1.1

We appreciate you feedback

vazquezjm commented 5 years ago

Wow, that was super fast!

Quick note: I added the following line to my project platformio.ini in order to start using 1.1.1 as described here

lib_deps = EasyButton@1.1.1

Although it looks like it is trying to download 1.1.1, I get this message:

image

Is that a PlatformIO issue?

evert-arias commented 5 years ago

@vazquezjm PlatformIO takes a few hours even a day to update its libraries registry. I suggest you wait a couple of hours until the new version is available on PlatformIO. https://platformio.org/lib/show/5741/EasyButton

evert-arias commented 5 years ago

This issue has been solved