Skip to content

Commit e7f390c

Browse files
committed
fixed missing button id for updating registers on PINB, PINC
1 parent a2ec217 commit e7f390c

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

examples/Multibutton/t.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Bugtton
2-
version=1.0.3
2+
version=1.0.4
33
author=Sami Kaukasalo <[email protected]>
44
maintainer=Sami Kaukasalo <[email protected]>
55
sentence=Fast button debounce library for ATmega328P. Uses registers instead of digitalRead.

src/Bugtton.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ void Bugtton::update(){
100100

101101
// Update currentBit from registers
102102
if (_pins[i] < 8) currentBit(i, PIND&(1<<_pins[i]) );
103-
else if (_pins[i] < 14) currentBit(PINB&(1<<(_pins[i]-8) ));
104-
else if (_pins[i] < 20) currentBit(PINC&(1<<(_pins[i]-14) ));
103+
else if (_pins[i] < 14) currentBit(i, PINB&(1<<(_pins[i]-8) ));
104+
else if (_pins[i] < 20) currentBit(i, PINC&(1<<(_pins[i]-14) ));
105105

106106
//No change in button state
107107
if ( currentBit(i) == oldBit(i)){

0 commit comments

Comments
 (0)