Encoder library not working?

i8dirt

New member
Hi,

I am a newb learning the Arduino via the teensy3. I am trying to talk to a quadrature encoder. I have tried the AdaEncoder.h library which also calls the PinChangeInt.h library, but the PinChangeInt.h is not compatible with a Teensy as best as I can tell.

I have also tried the Encoder library from pjrc:
http://www.pjrc.com/teensy/td_libs_Encoder.html
This may be compatible with teensy 1 & 2 but does not seem to be compatible with teensy 3.

I made a small test program just to see if the Arduino IDE will verify and it is not compiling. Am I screwing up the syntax or has this library not been ported to teensy 3 yet?

Thanks

#include <Encoder.h>
Encoder enc(5, 6);
int encnumber=0;
void setup(){
pinMode(5,INPUT);
pinMode(6,INPUT);
}
void loop() {
encnumber = enc.read();
}
 
Back
Top