I am trying to get my rotary encoder to work with my teensy 3.5 however I am pretty confused, it's been a few years since I have used a rotary encoder, but I don't remember having any issues like this in the past.
So I have a teensy 3.5, and this 7 way switch rotary encoder ... https://opensimracing.com/products/funky-switch-7-in-1
I first wired it up like this...
But then upon further reading I think this is more correct, not entirely sure...
Not sure if either of those are right, because I still cant get anything to work...
Here is the code I am currently working with, however I have tried several different iterations of this...
It pretty much always assumes to position is 0, so any help is appreciated
So I have a teensy 3.5, and this 7 way switch rotary encoder ... https://opensimracing.com/products/funky-switch-7-in-1
I first wired it up like this...
But then upon further reading I think this is more correct, not entirely sure...
Not sure if either of those are right, because I still cant get anything to work...
Here is the code I am currently working with, however I have tried several different iterations of this...
Code:
#include <Encoder.h>
Encoder enc(8,9);
long current_value;
long previous_value = 999;
void setup() {
Serial.begin(9600);
}
void loop() {
current_value = enc.read();
if (current_value != previous_value) {
Serial.println(current_value);
previous_value = current_value;
}
}
It pretty much always assumes to position is 0, so any help is appreciated