What is the aim of 'debounce' ? How can i set a interval between two clicks with Puck JS ? #3992
Replies: 1 comment
-
Posted at 2022-04-10 by @allObjects Every electro mechanical switch bounce, that means that the on and off transition is not a single flank but a sequence of ons and offs until the switch settles to a steady on or off status. The debouncing catches the first state change and then 'waits' a bit and checks again to consider it a state change and assesses what the final state is. In other words, the debounce option makes it easy for the program to overcome the flaws of switches. Some switches bounce more than others. By default, Espruino board built-in (mounted) switches use the For something you like you try to do, take a look at this conversation: Software Buttons - Many buttons from just one hardware button. The 'module' can figure sequences of long and short presse and pauses between these sequences following the concept of Morse Code. Long vs. Short press and the pauses between the presses of a sequence as well as the pause between sequences are configurable. The 'module' also detects sequences out of the order and ignores them as a whole. Posted at 2022-04-10 by user142416 Thanks for your answer, this will help me a lot ! Have a great day :) Posted at 2022-04-10 by @allObjects @user142416, enjoy the updated code (post #29... could not test it yet, though... if it does not work, used what is in post #25). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-04-09 by user142416
Hello, i'm new here and i dont' understanding the aim of 'debounce' with Puck.js. I would like to send info when the puck is clicked, when I click once, it is as if I had clicked 5 times. How can i set an interval between two clicks ? I think the actual delay is too short. This is an exemple :
Thanks for your help :)
Beta Was this translation helpful? Give feedback.
All reactions