Teensy 4 and #define ENC_PORT PINC

Status
Not open for further replies.

plemon

Member
I've been using a small bit of rotary encoder code on the Teensy 3.2 and have just bought a Teensy 4 to test.

The code has the following define statement:

#define ENC_PORT PINC

Which has worked on the previous Teensy iterations but not the 4. Does anyone have a quick explanation as to why?
 
It might help to have a lot more details, like what library are we talking about? Or sketch?
For example I did a quick search of all of the files installed by Teensyduino for ENC_PORT and did not find any hits.

But a strong guess is that you are using some old code that was originally written to run on Arduino AVR based boards like the UNO?

The Teensy 3.x code base has emulation code added to emulate the AVR registers, i.e. read input on PORT C. Note: There is no such thing as PortC on the T3.2 (or T4).

So far I don't believe we have migrated this emulation code over the T4.

Again there is no details given here, but would suggest trying to use a library that hopefully has been adapted to use native pins and the like:
hopefully encoder library works...
 
Again there is no details given here, but would suggest trying to use a library that hopefully has been adapted to use native pins and the like:
hopefully encoder library works...
The Teensy encoder library does work with the T4 - had tested that a couple of times with the T4 in beta testing so unless something drastic changed....
 
Status
Not open for further replies.
Back
Top