You can make any pin work with an interrupt using the attachInterrupt() function. The Uno and Nano only have two external interrupt pins (2 and 3), but the rest can also be used for interrupts. External interrupts have their own interrupt vector where other pin interrupts must share a vector. The attachInterrupt() function hides the bit masking that has to take place to determine which pin triggered the interrupt. There's some overhead with pin interrupts that external interrupts don't have, but will go unnoticed if the encoder is being turned by a human rather than a motor. Google "Arduino attachInterrupt" and you should find some sample code you can try.
From: Ryan Flowers <geocrasher@...> To:[email protected] Sent: Monday, March 5, 2018 4:34 AM Subject: [BITX20] uBITX Sketch on an Arduino Uno R3? #ubitx
Howdy all,
I'm trying to get the uBITX sketch working on an Arduino Uno R3, because it's what I have. The problem is that the rotary encoder is on A6 and A7, but the Uno doesn't have A6 and A7, only A0-A5. I'm trying to move the encoder to the digital pins, and I was able to get the encoder button working, but the encoder itself does not. Can anyone offer suggestions on making this work?