Closed jacobdekeizer closed 3 years ago
Hey, thanks for pointing this out and adding this. Will merge it!
This breaks compiling for Arduino for me. Compiling for ESP32 and ESP8266 both worked. I also tried a clean install of the Arduino IDE, only downloaded this library and only added #include "Button2.h" to an empty sketch and it didn´t compile:
fatal error: functional: No such file or directory
I tried to compile for both Uno and Nano.
@jacobdekeizer are you using an Arduino for your project or something else?
Hi, I am using an esp32. I didn't know the arduino uno does not support the c++ standard library. I found this example so we can target both esp32/esp8266 and arduino: https://github.com/blynkkk/blynk-library/blob/master/src/Blynk/BlynkConsole.h#L31.
Hey, I add pre-processor directives to detect ESP8266 & EPS32s and pushed a new released. The code now compiles on Arduino and these two platforms. I will keep it now as it is and maybe revisit it later to find a better solution.
Thanks @ItsFlo for finding the error and thanks @jacobdekeizer for suggesting a fix. Cheers
Hi,
Thank you for making this library. I needed to access the
this
context from a callback in my project, so that I could update a counter in my class. Having the CallbackFunction use std::function, makes it possible to use the C++11 lambda functions.My example: