新ロリコンがオープンコレクタらしいので、mode関数で内部プルアップするようにした。旧ロリコンはオープンコレクタではないので注意
Fork of QEI by
Diff: QEI.cpp
- Revision:
- 1:172296646075
- Parent:
- 0:5c2ad81551aa
--- a/QEI.cpp Thu Sep 02 16:48:55 2010 +0000 +++ b/QEI.cpp Thu Aug 16 08:49:45 2018 +0000 @@ -139,6 +139,9 @@ revolutions_ = 0; pulsesPerRev_ = pulsesPerRev; encoding_ = encoding; + + channelA_.mode(PullUp); + channelB_.mode(PullUp); //Workout what the current state is. int chanA = channelA_.read();