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

Confirmation on certain buttons


#1

I expect this might not be a common interest, but I have a few buttons or sliders that I don’t really want to bump by accident.

This is easily done at the moment just by sliding to scroll the remote.

If it had a confirmation as an option for certain sliders or buttons that would be good. Otherwise I need to create two buttons to be high to have safe triggering.


#2

Or a timeout on a single button that requests confirmation.


#3

Yes. Since your post I’m now considering long push or double push.


#4

I wish there was a button with a confirmation too. I have one button that would be really bad if it were accidentally pushed, and it would be nice to have a “Are you sure?” message accompany it. Pete, did you eventually settle on a solution?


#5

Yeh I made it so I had to double press the button within 1 second. Works fine for me.

Originally I had a latch (switch) switch and a push switch, so you had to click the latch (switch) switch then push the push switch which made it happen. Then had the code unlatch the latch switch.


#6

Like this you mean…

:rocket::rocket::rocket:


#7

Ha ha. Too much of a “pussy” to push it I’d hope


#8

Funny part is (well I found it funny for some reason) is that I thought my code was hung and the device wasn’t working… until I remembered about the double push derrr. So it obviously worked as I had to think about pushing the button the right way… No jokes about the wife please :slight_smile:


#9

image


#10

Your definition of pushing the right “buttons” was slightly more “family” friendly ha ha


#11

I had this problem on my project. I need some ‘confirm’ message or something else.

Can you describe your solution a little bit please?


#12

I now use this inside an if statement that gets triggered every time the button is pushed.

timePushed = millis() to record the time. But before that I have previousTimePushed = timePushed to record the previous time it was pushed.

The if statement compares the two variables to each other, and if it’s less than 2000 ms then run the function, else do nothing.

I’ll upload some code when I can to better explain it.


#13

Thank you so much. I can do it with this information. Its just like a phisical button long press.


#14

You could probably change the button text by using your code to indicate to push again. My application has a display box that I push “press again” too. Not really needed but it looks good.


#15

I use lcd widget in my project. It will be easy for project. And i found some idea.

@Dmitriy can we send text or value from hardware to button widget? Sounds like hardware sync button but i want to point on variable feedback.


#16

You can set on/off labels of button with setProperty - https://docs.blynk.cc/#blynk-main-operations-change-widget-properties


#17

Wow! I impressed again… So… I need to print all blynk documentation. Thank you and i could not find new idea again :frowning:

Someone found before me :unamused:


#18

A long-press button would be great to have!


#19

I think you can already. If you have the switch as push type, then when you hold the button a value of 1 will be sent to the virtual pin. Then on release the value of 0 gets sent.

If you have your code check to see if the value of the virtual pin is 1 for longer than 1000 milli seconds then do something.


#20

Until get this feature…

And as example, you can make a reset button with a slider.

To reset the hardware you can put the slider’s values as 0 and an high number… and if you slide the control without go to the last value, that is the expected value for reset’s trigger… the slider can be set to 0 after some seconds…