Button with slider

Hey,

is it possible to send data from slider, ONLY when button is pressed. What i want to say is i have a button widget, and a slider widget. I want to send the value from my slider ONLY when i press the button.

yes you can :wink:
when you press button sync slider

BLYNK_WRITE(V1) {//push button
 Blynk.syncVirtual(V2); // read slider
//do something
}

BLYNK_WRITE(V2) {//slider
value= param.asInt();
}

So this will just ignore the slider value but pass it anyway, i find this as a bad solution because im using data internet on my project and sending (useless) data constantly will rise my expenses, is there a way I can stop the slider data transmission?

The App is always talking to the Server which is always talking to the devices… so some data transfer is always happening, hence IoT :stuck_out_tongue_winking_eye:

Perhaps adding in some if else() logic so that the slider vPin syncing only happens when button is HIGH will help… so many ways of doing this.

And, unless you are actually moving the slider then the server/device will not be getting constant updates and only using whatever was the last value.

1 Like