pierrelenfestey
New member
Apologies if this is going over old ground. I'm a newbie with rotary encoders and I'm using the RGB encoder from Sparkfun (https://www.sparkfun.com/products/15141) with a Teensy 3.5
I'm getting weird readings form the encoder examples, both the "Basic" and "NoInterrupts" versions of the code. I'm eventually looking to use the encoder and Teensy to emulate a keyboard, so that I can program keystrokes into it and use it as an aid to shuttle backwards and forwards in an editing programme's timeline.
I have the encoder wired as follows:
Encoder pin A - pin13
Encoder Pin B - Pin14
Encoder Pin C (centre pin) - GND
and I'm getting the following on the serial monitor:
1
0
1
0
-1
0
1
0
-1
-2
-3
-4
-5
-6
-7
-8
The way these readings are generated are making me think that I've got the wiring wrong. When I rotate the encoder in one direction I get the reading alternating between 0 and 1 (or -1 depending on how I assign the pins in the code). When I rotate it in the other direction I usually get 4 numbers in quick succession incrementing in the opposite direction.
I've also tried adding 100nF caps between encoder pins A to GND and B to GND - same results
I've also tried using another encoder (same type) - same results.
I'm sure I'm doing something fundamentally wrong, but don't know what it is. I'm hoping it's something that will end with me face-palming
If you need me to post the code, I will, but it's the standard code from the Arduino Examples libraries.
I'm getting weird readings form the encoder examples, both the "Basic" and "NoInterrupts" versions of the code. I'm eventually looking to use the encoder and Teensy to emulate a keyboard, so that I can program keystrokes into it and use it as an aid to shuttle backwards and forwards in an editing programme's timeline.
I have the encoder wired as follows:
Encoder pin A - pin13
Encoder Pin B - Pin14
Encoder Pin C (centre pin) - GND
and I'm getting the following on the serial monitor:
1
0
1
0
-1
0
1
0
-1
-2
-3
-4
-5
-6
-7
-8
The way these readings are generated are making me think that I've got the wiring wrong. When I rotate the encoder in one direction I get the reading alternating between 0 and 1 (or -1 depending on how I assign the pins in the code). When I rotate it in the other direction I usually get 4 numbers in quick succession incrementing in the opposite direction.
I've also tried adding 100nF caps between encoder pins A to GND and B to GND - same results
I've also tried using another encoder (same type) - same results.
I'm sure I'm doing something fundamentally wrong, but don't know what it is. I'm hoping it's something that will end with me face-palming
If you need me to post the code, I will, but it's the standard code from the Arduino Examples libraries.