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
452 stars 63 forks source link

Error using library #12

Closed sunishnet closed 5 years ago

sunishnet commented 5 years ago

I get the following error message

EasyButtonTouch.cpp:21:23: error: 'touchRead' was not declared in this scope return touchRead(_pin) < _touch_threshold;

while trying to verify the code in Arduino/VSCode IDE. This happens whether the board is Arduino Uno or ESP8266

evert-arias commented 5 years ago

Capacitive touch GPIOs are only available in ESP32. I'll highlight it in the library documentation.

sunishnet commented 5 years ago

That's understandable, but why is the touch code getting invoked on a sample with normal switch on ESP8266 and Uno ?

evert-arias commented 5 years ago

You're right, the touch code should only be invoked for ESP32. I have already applied the solution recommended by @gutierrezps at https://github.com/evert-arias/EasyButton/pull/11

A new version has been released https://github.com/evert-arias/EasyButton/releases/tag/v1.0.2

Thanks

sunishnet commented 5 years ago

I checked the new version and it compiles and works fine. Thanks