hi @Blynk_Coeur and @steve1,
sorry to open this post again but I have the same problem, I need some secure buttons that must be intentional pushed/activated.
I tried your code but it give me a lot of compiling errors.
Can you add the libraries to include, the variable declarations and where to put your code, if inside the setup loop or where.
Do I need to use a special widget in the Blynk App or just buttons?
hi @Gunner ,
I’m sorry for that, as my question was related to the code of them I thought it was the right place.
I try to include BlynkTimer and to test it again.
Hi @Gunner,
your code is not perfect… I’m joking!
I would like to have just 10% of your knowhow of Blynk programming, however this is wath I did.
Your code switch to "True" just moving the slider up to 51% even without reaching the end and doesn’t come back if you move it below the 50%, it stay there.
What I did is, adding 1 decimal to the Slider Widget in order to have also values between 0 and 1, in this way it will be "True" only if it reache the end and comes back if you leave it in whatever position.
I tested the code of @Blynk_Coeur too but yours is more what I was looking for.
Try it out, it seems a real Sliding Button now.
It’s a workaround and it works fine, but if the Blynk Staff will include a Widget in the App, people don’t have to program a lot and nobody will ask again for a “Secure Button” or, even worse, reopen old posts like I did.
@Blynk_Coeur’s code could be adapted to almost any of the input widgets. You just basically have each of the corresponding BLYNK_WRITE() commands follow the format.
I agree that it is pretty clever indeed. And quite simple.
Blasphemy … I worked long hard minutes to come up with that
Yes, it was quick and dirty… Getting around the 51% is just a matter of stretching out the range, but only reacting to the final value. And same with moving less than 50% as an else value could activate return to 0.
EDIT - Oops, now I look at your code and see you already did similar to all that. Good job
That use of the #.# was sooo simple… I am stealing that for my code examples
PS, Sooo many options with code… and on that note …
I don’t find code a workaround, rather it is ultimate customisable control If I ever learn to code quality App GUIs I would be self sufficient. But for now Blynk is by far the best to work with overall.