add pullup
Dependents: PID_VelocityExample
Fork of QEI by
Revision 1:0da4d510e7b8, committed 2016-06-27
- Comitter:
- soulx
- Date:
- Mon Jun 27 23:11:31 2016 +0000
- Parent:
- 0:5c2ad81551aa
- Commit message:
- add pullup
Changed in this revision
QEI.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/QEI.cpp Thu Sep 02 16:48:55 2010 +0000 +++ b/QEI.cpp Mon Jun 27 23:11:31 2016 +0000 @@ -134,12 +134,14 @@ int pulsesPerRev, Encoding encoding) : channelA_(channelA), channelB_(channelB), index_(index) { - + pulses_ = 0; revolutions_ = 0; pulsesPerRev_ = pulsesPerRev; encoding_ = encoding; + channelA_.mode(PullUp); + channelB_.mode(PullUp); //Workout what the current state is. int chanA = channelA_.read(); int chanB = channelB_.read();