Fork of mRotaryEncoder for mdeb-os. uses newer version of PinDetect. Testprogram: https://os.mbed.com/users/charly/code/mRotaryEncoder_HelloWorld-os/
Dependents: mRotaryEncoder_HelloWorld-os TMC2209-Test2
Diff: mRotaryEncoder.cpp
- Revision:
- 7:ec80fd9c0c08
- Parent:
- 5:75ddffaf3721
- Child:
- 10:2502b829d452
diff -r 854c349157b0 -r ec80fd9c0c08 mRotaryEncoder.cpp --- a/mRotaryEncoder.cpp Wed Mar 11 21:08:31 2015 +0000 +++ b/mRotaryEncoder.cpp Wed Mar 11 21:45:46 2015 +0000 @@ -52,8 +52,10 @@ if (*m_pinA == 0) { if (*m_pinB == 1) { m_position++; + rotCWIsr.call(); } else { m_position--; + rotCCWIsr.call(); } } rotIsr.call(); // call the isr for rotation @@ -65,8 +67,10 @@ if (*m_pinA == 1) { if (*m_pinB == 1) { m_position--; + rotCCWIsr.call(); } else { m_position++; + rotCWIsr.call(); } } rotIsr.call(); // call the isr for rotation