BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Timer widget Disable button


#1

A “Disable” button for this widget would be useful.


#2

Just add your own… we have to use code for that widget anyhow, what is another line or two :slight_smile:

BLYNK_WRITE(V0) {  // Timer Widget Enable Button
  widgetTimerEnable = param.asInt();
}

BLYNK_WRITE(V1) {  // Timer Widget
  widgetTimer = param.asInt();
  if (widgetTimer == 1 && widgetTimerEnable == 1) {
    // Do Timer ON stuff
  } else if (widgetTimer == 0 && widgetTimerEnable == 1) {
    // Do Timer OFF stuff
  } else {
    // do nothing
}

#3

dont have any code running for that widget ?


#4

Not sure what you mean… the basic Timer Widget just toggles a vPin (in my example, V1), so the above code will react to timer changes.

You can of course run a sync command to periodically check the timer pin status in case of device reboots, etc.