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:
- 2:f99ac9745a2c
- Parent:
- 0:562943b05e99
- Child:
- 3:39c2fc4482be
diff -r bb7b4e631dff -r f99ac9745a2c mRotaryEncoder.cpp --- a/mRotaryEncoder.cpp Mon Nov 29 21:38:17 2010 +0000 +++ b/mRotaryEncoder.cpp Tue Feb 01 19:43:46 2011 +0000 @@ -15,8 +15,11 @@ m_pinA->fall(this, &mRotaryEncoder::fall); // Switch on pinSW - m_pinSW = new InterruptIn(pinSW); // interrupt on press switch + m_pinSW = new PinDetect(pinSW); // interrupt on press switch m_pinSW->mode(pullMode); + + m_pinSW->setSampleFrequency(); // Defaults to 20ms. + m_position = 0;