I'm trying to make a wifi controlled led strip dimmer based around a Wemos D1 mini. I've already build the dimmer electronics and got the MQTT communication to OpenHab working. But now I am trying to also make the leds controlled by a capacitive touch button.
But here is the problem: The MQTT library of adafruit requires a 5 second loop where it checks for incoming messages. But whilst checking, it cannot check the capacitive touch button. So to turn off the leds, I sometimes have to touch te button for 5 seconds before they turn off...
Does anyone know of a solution for this problem?