News for hackers. Stuff that matters.
Re:How Jeff Geerling almost broke MrBeast's 1-100 video [video] by rowanG077 on Monday September 18, 2023 @07:31AM (#37554813)
(3) is the usual way debouncing is handled, just ignore inputs for a set time after a trigger has been detected. And this is about the second lecture in an embedded software course. So from that I got that the guys aren't really domain experts. Which honestly makes it more impressive to me that the managed to pull it off.
Re:How Jeff Geerling almost broke MrBeast's 1-100 video [video] by jstanley on Monday September 18, 2023 @08:04AM (#37555058)
My least favourite implementation of that is requiring some delay with no changes before the input is considered triggered.

I have at least 2 kitchen appliances where the delay is too high, and the user experience is that you have to press and hold the button in order to trigger it, because tapping it too fast doesn't count.

So frustrating, when the right way to do it is so easy.

Re:How Jeff Geerling almost broke MrBeast's 1-100 video [video] by geerlingguy on Monday September 18, 2023 @08:20AM (#37555166)
There's a ton of nuance to something as simple as debounce, and that's why the Ganssle article is so great; unlike the simple comments ("just add a 100ms sleep to your code!"), it explores the end to end experience with each given solution, both in hardware and in pseudo code.

Too many people find a solution that fits the bare minimum requirement and move on, leading to years of frustration from the end users. Spend a little more time using the thing like an end user would, and you can solve that issue much better, usually.

Re:How Jeff Geerling almost broke MrBeast's 1-100 video [video] by guepe on Monday September 18, 2023 @09:09AM (#37555599)
De bouncing is solved in hw with right-sized capacitor. That's it....
Re:How Jeff Geerling almost broke MrBeast's 1-100 video [video] by ilyt on Monday September 18, 2023 @09:23AM (#37555754)
You need schmitt trigger input to do it properly and most microcontrollers don't have it.
Re:How Jeff Geerling almost broke MrBeast's 1-100 video [video] by rowanG077 on Monday September 18, 2023 @10:26AM (#37556548)
I really, really hate HW solution for something so easily solved in Software.
Re:How Jeff Geerling almost broke MrBeast's 1-100 video [video] by numpad0 on Monday September 18, 2023 @03:45PM (#37561026)
In reality you implement both. Basic noise filtering in hardware, plus rate limiting or something in software.

onClick event handlers in most GUI triggers on mouse button releases, for example.

Re:How Jeff Geerling almost broke MrBeast's 1-100 video [video] by rowanG077 on Monday September 18, 2023 @04:04PM (#37561256)
I have almost never seen hardware debouncing. It's just way better done in software. Unless you have extremely specialized switched which require HW debouncing(???), please just do it in software.
Re:How Jeff Geerling almost broke MrBeast's 1-100 video [video] by numpad0 on Monday September 18, 2023 @06:20PM (#37562908)
Really? A button just coming from GPIO into a 10k to ground? Is CPU not going to randomly lock up?
Re:How Jeff Geerling almost broke MrBeast's 1-100 video [video] by rowanG077 on Monday September 18, 2023 @08:13PM (#37564058)
There is no reason the CPU is going to lock up. Bounce is not random spurious triggers.
Re:How Jeff Geerling almost broke MrBeast's 1-100 video [video] by ilyt on Monday September 18, 2023 @09:32AM (#37555860)
There is ton of nuance in the physics but "trigger on first and wait" is objectively fastest response way to do it.

Only reason to do it other way is if you have some limitations. Like timer being costly on resources (valid concern for microcontroller)

> Too many people find a solution that fits the bare minimum requirement and move on, leading to years of frustration from the end users. Spend a little more time using the thing like an end user would, and you can solve that issue much better, usually.

A little time won't give you much. Those are kind of problems where you need to be using it daily in anger to find the issues.

Like the buttons on elevator where I live. I press the button, it lights up, I do it few more times, debounce works fine!

Another day I'm in hurry, press it quickly, does not work. Turns out someone picked the worst way to debounce (wait till it is ON for that amount of ms), and on top of that tied LED to button itself so you see the light flash but button does not turn on). So you can't just tap it quickly, and you can't risk tapping it more than once because that would cancel the floor request

Re:How Jeff Geerling almost broke MrBeast's 1-100 video [video] by bombcar on Monday September 18, 2023 @08:10AM (#37555101)
I would love for an “old man murray” style reviews for things like kitchen equipment and workshop tools that focused entirely on the device UI.

Maybe I just need a microwave with Cherry MX keycaps.

Re:How Jeff Geerling almost broke MrBeast's 1-100 video [video] by ilyt on Monday September 18, 2023 @09:22AM (#37555747)
Elevator in my apartment is like that, so annoying