I'm using EncoderTool.h (version 3.2.0 + Teensyduino 1.59) on T4.1 with a Bourns 24 detent encoder (PEC11R-4215F-S0024) and getting an error for the very first anti-clockwise adjustment after power up. The error arises between the initial and next (anti-clockwise) detent, as soon as the encoder is moved even the slightest. But it only occurs once, and only if the first adjustment is anti-clockwise, and not for clockwiise adjustments.
The following standard encoder test code reproduces this error for me.
When working correctly, this prints 1 for slow clockwise adjustments, and -1 for anti-clockwise adjusments. But more often than not, the first anti-clockwise adjustment after power up prints
1
-1
rather than just -1.
After the first adjustment, or if the first adjustment is clockwise, everything works as it should.
Seems to be a bug?
The following standard encoder test code reproduces this error for me.
Code:
#include <EncoderTool.h>
using namespace EncoderTool;
Encoder eA0;
void setup() {
eA0.begin(17, 16);
eA0.setValue(0);
}
void loop() {
if (eA0.valueChanged() )
{
int delta = eA0.getValue();
Serial.println(delta);
eA0.setValue(0);
}
delay(10);
}
When working correctly, this prints 1 for slow clockwise adjustments, and -1 for anti-clockwise adjusments. But more often than not, the first anti-clockwise adjustment after power up prints
1
-1
rather than just -1.
After the first adjustment, or if the first adjustment is clockwise, everything works as it should.
Seems to be a bug?
Last edited: