mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-10 01:43:40 +00:00
makeybutton: use smaller buffer for faster response
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
committed by
Daniel Esteban
parent
d0163c67f5
commit
1f54c7dd23
@@ -61,7 +61,7 @@ func (b *Button) Get() ButtonEvent {
|
||||
b.readings.Put(pressed)
|
||||
|
||||
switch {
|
||||
case pressed && avg > 0:
|
||||
case pressed && avg > -1 * bufferSize - 2:
|
||||
if b.state == Press {
|
||||
return NotChanged
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user