Skip to content

Commit 1391936

Browse files
committed
Attaching interrupts with correct numbers. PIN 2 --> 0 and PIN 3 --> 1.
1 parent 596a11b commit 1391936

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/main.ino

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,16 @@ void setup()
316316
digitalWrite(ROTARY_ENC_A, HIGH); //turn pullup resistor on
317317
digitalWrite(ROTARY_ENC_B, HIGH); //turn pullup resistor on
318318

319+
#if 0
319320
//call updateEncoder() when any high/low changed seen
320321
attachInterrupt( digitalPinToInterrupt(2), ISR_ON_PIN2, RISING);
321-
// attachInterrupt( (2), ISR_ON_PIN2, RISING);
322322
attachInterrupt( digitalPinToInterrupt(3), ISR_ON_PIN3, RISING);
323-
// attachInterrupt( (3), ISR_ON_PIN3, RISING);
323+
#else
324+
// NOTE: This changes with board. Testing with UNO. The above snippet is
325+
// preferred when available.
326+
attachInterrupt(0, ISR_ON_PIN2, RISING);
327+
attachInterrupt(1, ISR_ON_PIN3, RISING);
328+
#endif
324329

325330

326331
// fixme: move after wait_for_start

0 commit comments

Comments
 (0)