PaulStoffregen / Encoder

Quadrature Encoder Library for Arduino
http://www.pjrc.com/teensy/td_libs_Encoder.html
540 stars 239 forks source link

Add support for Arduino SAMD21 pin mapping #28

Open tuna-f1sh opened 6 years ago

tuna-f1sh commented 6 years ago

The comment about interrupts not working on the Arduino Zero seems out of date, not enough pins are defined however - this was what prevented it working for me. I first used #13 but found that the code changes are not required to get it working - perhaps the core has changed since or @hanyazou was re configuring the pin accidentally in setup()?

Unfortunately SAMD variants of Arduinos have different mapping and expose different interrupt pins so not all SAMD21G18A are equal. There was no define that I could find separating them but the variant.cpp manages the hardware pin mapping so there is no issue with a user specifying a pin that does not map to an interrupt other than it not working. I've commented exclusive pins.

CDRXavier commented 2 years ago

I think there is a way to see the exact type of board used for compiling? Same as you would differentiate between the other different boards? The problem is the m0 is used in massively different boards, different MKR and including the Zero, with different amount of exposed pins, etc.