Encoder Library

Hello,

For a while now I have been using my own implementation for rotary encoders. I always thought that the following library was only for Teensy.

https://www.pjrc.com/teensy/td_libs_Encoder.html

Realizing that it is not, I attempted to implement it on the Due. I am without luck. I change Basic example to the pins I have been using for a while now, and the nothing is happening when I rotate the encoder.

My board and encoders are fine because I can see the signals with a scope and I have been using these boards for a year now.

I am using pins 18 and 19, which look to valid (I checked the pin configuration file) of the library.

I am using software version 1.6.3 with the teensyduino add-on.

EDIT:

The Basic example does not work, but the NoInterrupts example works. I would like to get the Basic example working. I feel like this is an internal problem.

Thanks, Daniel

The code isn't compatible with the Due interrupts as far as I can tell, lots of CORE_INTx_PIN #defines would be needed.

I figured,

I ended up using another method.

Thanks,

I'm the author of this library.....

MarkT: The code isn't compatible with the Due interrupts as far as I can tell, lots of CORE_INTx_PIN #defines would be needed.

In theory, there's lines in utility/interrupt_pins.h for Arduino Due. So it's supposed to work, with Due has working attachInterrupt(num, CHANGE).

In practice, little testing has been done. I really don't have time to test and troubleshoot the code for Due... but if anyone can, I'd be happy to accept a pull request for better defs or specific code for Due.