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 QEI by
Revision 1:7eb92981c3fd, committed 2018-08-04
- Comitter:
- tanabe2000
- Date:
- Sat Aug 04 06:56:56 2018 +0000
- Parent:
- 0:5c2ad81551aa
- Commit message:
- tnbQEI
Changed in this revision
QEI.cpp | Show annotated file Show diff for this revision Revisions of this file |
QEI.h | 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 Sat Aug 04 06:56:56 2018 +0000 @@ -133,7 +133,11 @@ PinName index, int pulsesPerRev, Encoding encoding) : channelA_(channelA), channelB_(channelB), + led(LED2), index_(index) { + + channelA_.mode(PullUp); + channelB_.mode(PullUp); pulses_ = 0; revolutions_ = 0; @@ -236,7 +240,7 @@ // predict - if this is the case, it is generally safe to ignore it, update // the state and carry on, with the error correcting itself shortly after. void QEI::encode(void) { - +// led = !led; int change = 0; int chanA = channelA_.read(); int chanB = channelB_.read();
--- a/QEI.h Thu Sep 02 16:48:55 2010 +0000 +++ b/QEI.h Sat Aug 04 06:56:56 2018 +0000 @@ -238,6 +238,7 @@ volatile int pulses_; volatile int revolutions_; + DigitalOut led; };