tested software encoder

This commit is contained in:
hathach committed 2017-09-14 23:09:05 +07:00
1 parent 97114cb54d
commit 2e61dab738
6 files changed
+68 -10

No files matched your search

+2 -1
View File
@@ -151,7 +151,8 @@ int32_t HwRotaryEncoder::read(void)
// Trigger READ CLR ACC
NRF_QDEC->TASKS_RDCLRACC = 1;
int32_t val = NRF_QDEC->ACCREAD;
// Nordic QDEC CW is negative, CCW is positve --> invert
int32_t val = -(NRF_QDEC->ACCREAD);
// Add to absolute value and buffered step
_abs += val;