DEBOUNCE(9)
π DEBOUNCE(9) π
okay bestie, sit down, we're talking about debounce from the HAL Component manual, and honestly? she's iconic. she filters noisy digital inputs so your signal stops being a chaotic mess. periodt.
β¨ NAME β¨
debounce β filter noisy digital inputs π
πΈ SYNOPSIS πΈ
loadrt debounce cfg=size[,size,...]
So the way this works: it creates debounce groups, and each group has however many filters you told it to have (that's the size). Every filter inside the same group shares the same sample rate and the same delay β they're all matching, it's giving coordinated friend group energy. π«Ά
For example, cfg=2,3 creates two filter groups: the first group gets 2 filters, and the second group gets 3 filters. simple as that, no cap.
π¦ NOTE π¦
There's an alternate component named dbounce that does similar functionality but uses the conventional count= and names= parameters instead. and listen β with dbounce, the delay settings are implemented by a delay pin for each instance, instead of using filter groups. different vibe, same goal π
π DESCRIPTION π
The debounce filter works by incrementing a counter whenever the input is true, and decrementing the counter when it's false. like, the counter is the main character and the input is just... feeding it.
Here's the tea β:
- If the counter decrements to zero, the output is set false and the counter ignores any further decrements. she's done, she's not going lower, we respect the boundary.
- If the counter increments up to a threshold, the output is set true and the counter ignores further increments. locked in. π
- If the counter is somewhere between zero and the threshold, the output just retains its previous state. no drama, no change.
- The threshold determines the amount of filtering: a threshold of
1does no filtering at all, and a threshold ofNrequires a signal to be present forNsamples before the output changes state.
π₯ FUNCTIONS π₯
debounce.Gβ Sample all the input pins in group G and update the output pins. she's doing the whole group's homework in one go, efficient queen π
π PINS π
debounce.G.F.in bit inβ The F'th input pin in group G. the raw, noisy little gremlin coming in πdebounce.G.F.out bit outβ The F'th output pin in group G. Reflects the last "stable" input seen on the corresponding input pin. this one's the calm, collected version β¨debounce.G.delay signed rwβ Sets the amount of filtering for all pins in group G. one setting, whole group, slay π
aaaand that's the whole page bestie, you ate it π
this was brought to you by LinuxCNC Documentation, dated 2007-01-16 β yes she's an older icon but she still hits, no cap πβ¨
π¦ where this page comes from
- debian bookworm: linuxcnc-uspace 2.9.0~pre1+git20230208.f1270d6ed7-1+deb12u2 Β· GFDL-1.1-or-later
- debian trixie: linuxcnc-uspace 1:2.9.4-2+deb13u1 Β· GFDL-1.1-or-later
- ubuntu questing: linuxcnc-uspace 1:2.9.4-2ubuntu2
- ubuntu resolute: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- ubuntu stonking: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms