Skip to content

Commit 4afe72f

Browse files
committed
Correct the rotary trinkey examples inverting the button state. Fixes #2370
1 parent 50b702f commit 4afe72f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Rotary_Trinkey/surfacedial_encoder_demo/surfacedial_encoder_demo.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void loop() {
4747
int curr_rotary = encoder.getPosition();
4848
RotaryEncoder::Direction direction = encoder.getDirection();
4949
// read switch
50-
bool curr_button = !digitalRead(PIN_ENCODER_SWITCH);
50+
bool curr_button = digitalRead(PIN_ENCODER_SWITCH);
5151

5252
if (direction != RotaryEncoder::Direction::NOROTATION) {
5353
Serial.print("Encoder value: ");

Rotary_Trinkey/volumemute_encoder_demo/volumemute_encoder_demo.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void loop() {
4747
int curr_rotary = encoder.getPosition();
4848
RotaryEncoder::Direction direction = encoder.getDirection();
4949
// read switch
50-
bool curr_button = !digitalRead(PIN_ENCODER_SWITCH);
50+
bool curr_button = digitalRead(PIN_ENCODER_SWITCH);
5151

5252
if (direction != RotaryEncoder::Direction::NOROTATION) {
5353
Serial.print("Encoder value: ");

0 commit comments

Comments
 (0)