update rotary encoder

This commit is contained in:
hathach committed 2017-09-13 21:38:58 +07:00
1 parent a63f53f75d
commit 9177cb48db
2 files changed
+26 -13

No files matched your search

+5 -2
View File
@@ -47,7 +47,8 @@ class RotaryEncoder
_pinb = pinb;
_pinled = pinled;
_abs = 0;
_abs = 0;
_step = 0;
}
void begin(void);
@@ -68,7 +69,9 @@ class RotaryEncoder
uint8_t _pina, _pinb;
int8_t _pinled;
int32_t _abs;
// Note For each turn, encoder generate 2 transitions
int32_t _abs; // Absolute position
int32_t _step; // Moving step that take intermidiate transition in account
};