Correct the rotary trinkey examples inverting the button state. Fixes #2370

This commit is contained in:
Deanna Earley 2022-12-30 11:12:59 +00:00
parent 50b702f550
commit 4afe72fe28
2 changed files with 2 additions and 2 deletions

View file

@ -47,7 +47,7 @@ void loop() {
int curr_rotary = encoder.getPosition(); int curr_rotary = encoder.getPosition();
RotaryEncoder::Direction direction = encoder.getDirection(); RotaryEncoder::Direction direction = encoder.getDirection();
// read switch // read switch
bool curr_button = !digitalRead(PIN_ENCODER_SWITCH); bool curr_button = digitalRead(PIN_ENCODER_SWITCH);
if (direction != RotaryEncoder::Direction::NOROTATION) { if (direction != RotaryEncoder::Direction::NOROTATION) {
Serial.print("Encoder value: "); Serial.print("Encoder value: ");

View file

@ -47,7 +47,7 @@ void loop() {
int curr_rotary = encoder.getPosition(); int curr_rotary = encoder.getPosition();
RotaryEncoder::Direction direction = encoder.getDirection(); RotaryEncoder::Direction direction = encoder.getDirection();
// read switch // read switch
bool curr_button = !digitalRead(PIN_ENCODER_SWITCH); bool curr_button = digitalRead(PIN_ENCODER_SWITCH);
if (direction != RotaryEncoder::Direction::NOROTATION) { if (direction != RotaryEncoder::Direction::NOROTATION) {
Serial.print("Encoder value: "); Serial.print("Encoder value: ");