From 34eb7e8addc55f47aa6f25c77d7b15a402e3085f Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 28 Mar 2020 17:08:27 -0400 Subject: [PATCH] Define data pins and attach interrupts using pin numbers --- hidReader.ino | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hidReader.ino b/hidReader.ino index 537d813..421cf27 100644 --- a/hidReader.ino +++ b/hidReader.ino @@ -9,6 +9,10 @@ #include #include +// DATA pins +#define DATA0 2 +#define DATA1 3 + // LED pins #define LED_GREEN 11; #define LED_RED 12; @@ -42,13 +46,13 @@ void ISR_INT1() { } void setup() { - pinMode(2, INPUT); // DATA0 (INT0) - pinMode(3, INPUT); // DATA1 (INT1) + pinMode(DATA0, INPUT); + pinMode(DATA1, INPUT); Serial.begin(9600); - attachInterrupt(0, ISR_INT0, FALLING); - attachInterrupt(1, ISR_INT1, FALLING); + attachInterrupt(digitalPinToInterrupt(DATA0), ISR_INT0, FALLING); + attachInterrupt(digitalPinToInterrupt(DATA1), ISR_INT1, FALLING); Keyboard.begin(); }