Add ESP32 touch sensors as button alternative (#1190)

* Add touch option to button handler

* Check if touch is pressed in setup

* Add TOUCHPIN build env and override example

Co-authored-by: Aircoookie <dev.aircoookie@gmail.com>
This commit is contained in:
Jake
2020-09-20 16:12:46 +02:00
committed by GitHub
parent 1313a44ba3
commit a3e1af72ab
6 changed files with 29 additions and 6 deletions

View File

@@ -250,8 +250,8 @@ void WLED::beginStrip()
#endif
// disable button if it is "pressed" unintentionally
#ifdef BTNPIN
if (digitalRead(BTNPIN) == LOW)
#if defined(BTNPIN) || defined(TOUCHPIN)
if (isButtonPressed())
buttonEnabled = false;
#else
buttonEnabled = false;