Open dicagno opened 1 year ago
If you would like to use it, I have edited Examples -> Basic
long oldPosition = -999;
void loop() {
long newPosition = myEnc.read();
int direction = 0;
if (newPosition != oldPosition) {
direction = (newPosition > oldPosition) ? 1 : -1;
oldPosition = newPosition;
Serial.println(newPosition);
}
}
@bwalc0 thanks for the answer. Did you take a look at the associated PR?
Description
A method to determine step direction is missing and would be a great nice-to-have.
Steps To Reproduce Problem
No method to get step direction.
Hardware & Software
Board: any Shields / modules used: any
Usage
Errors or Incorrect Output
--