Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of scoreLight_Advanced by
Diff: hardwareIO/CRotaryEncoder.cpp
- Revision:
- 44:46e25fa1669b
- Parent:
- 42:c4e9c1116af4
diff -r 5ff1a26d99ac -r 46e25fa1669b hardwareIO/CRotaryEncoder.cpp --- a/hardwareIO/CRotaryEncoder.cpp Fri Mar 28 10:25:06 2014 +0000 +++ b/hardwareIO/CRotaryEncoder.cpp Mon Mar 31 10:57:35 2014 +0000 @@ -8,10 +8,12 @@ CRotaryEncoder::CRotaryEncoder(PinName pinA, PinName pinB) { m_pinA = new InterruptIn(pinA); + m_pinA->mode(PullUp); // this is for use in the case of the simple contact based rotary encoder (common is tied to ground) m_pinA->rise(this, &CRotaryEncoder::rise); m_pinA->fall(this, &CRotaryEncoder::fall); m_pinB = new DigitalIn(pinB); + m_pinB->mode(PullUp); m_position = 0; newValue=true;