|
|
|
|
|
by xani_
1351 days ago
|
|
> Depending on the quality of the switch, the bouncing time will vary. The most popular Cherry MX switches have a bouncing time of up to 5ms. This means the software delay should at least be 5ms or higher. That is incorrect. You can register and send "key held" input on the first bounce, immediately, then just ignore the key for the debouncing interval. Probably still want some capacitance on the input to not get triggered by any EMI tho. That moves the latency to key depress but as there is a very little chance someone presses key for less than 10ms it doesn't matter. The "interrupt, wait, interrupt, send signal" method might be easier to code I guess, especially if you just have few buttons and use hardware interrupts for them. |
|