Encoder library pin definitions? #996
Replies: 2 comments 3 replies
-
You may want to read this |
Beta Was this translation helpful? Give feedback.
-
covers the defines I use. Paul's libraries are not designed to work with modern AVRs and he simply ignores PR's to improve compatibility. I've had one on one of his other libraries open for years that would in one change support every modern AVR..... sigh.... think you want either this...
Or with them defined as just the number (eg, #define CORE_INT0_PIN 0) , depending on what exact trickery it's up to. I think I saw it successively testing if CORE_INTn_PIN was defined, so lines corresponding to pins that don't exist probably should be #if'ed out which can be done several ways with the defines we provide. (There are more beyond this that are all equivalent tests) PC4-5 and PB6-7 can be guarded with Anyway - I think I'm missing something - this library seems to be a really complex and unnecessary construction to do something that's pretty cookbook, and that method doesn't involve Encoder (on classic AVRs, as you may recall, attach only worked on the INTn pins - they merged the functionality of INTn and PCINT into one thing - one vector per port, but all 4 interrupt modes selectable per pin)
|
Beta Was this translation helpful? Give feedback.
-
I've started using this library: https://github.com/PaulStoffregen/Encoder and my first project was based around a 1614. Discovered that the library didn't know about it, so I added a small block in the interrupt_pins.h file to get me going.
I'm now using a 3216 and discovered I need to add that too :-)
For the 1614, I used:
#elif defined(__AVR_ATtiny1614__ )
It occurs to me there should be a smarter way of including x14, x16 etc parts, rather than each one.
What's the correct defines to use for each class of part?
Beta Was this translation helpful? Give feedback.
All reactions