Code: Select all
n = digitalRead(encoder0PinA);
if ((encoder0PinALast == LOW) && (n == HIGH)) {
if (digitalRead(encoder0PinB) == LOW) {
encoder0Pos--;
} else {
encoder0Pos++;
}
}
encoder0PinALast = n;
Encoder is Piher CI-11 (2 bit in quadrature code).
Does anyone have an example how to properly read the encoder or give any tips how to interface it properly to startKit and reading algorithm.