Closed SteveGuidi closed 1 year ago
Thanks for opening this PR. What is the motivation for the change?
Hi Brian:
I'm working with a generalized module that will attach an ISR function for a given pair of rotary encoder pins. I'd like to be able to pass an instance of Rotary
to this function so that the pins may be inferred instead of provided explicitly -- that way, there is no chance that a user may configure Rotary
with one pair of pins, but accidentally define interrupts for an unrelated set of pins.
Psuedo-code example:
void Initialize(const Rotary& encoder) {
enableInterrupt(encoder.pin_1(), onEncoderPinChange, RISING);
enableInterrupt(encoder.pin_2(), onEncoderPinChange, RISING);
};
I see, thanks for the explanation
Thanks again for the PR
Thank you, and glad to be of help!
Allows for read-only retrieval of the encoder's A/B pins after construction.