a
Dependents: wheelchaircontrol wheelchaircontrol2 wheelchaircontrol3 wheelchaircontrol4 ... more
Revision 3:0035b165ecc4, committed 2018-08-31
- Comitter:
- jvfausto
- Date:
- Fri Aug 31 17:09:18 2018 +0000
- Parent:
- 2:2a173fdae3ca
- Child:
- 4:17d461de6a8f
- Child:
- 5:dc96133b5129
- Commit message:
- f
Changed in this revision
QEI.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/QEI.cpp Fri Aug 03 20:28:47 2018 +0000 +++ b/QEI.cpp Fri Aug 31 17:09:18 2018 +0000 @@ -235,7 +235,7 @@ int change = 0; int chanA = channelA_.read(); int chanB = channelB_.read(); - + // printf("in here\r\n"); //2-bit state. currState_ = (chanA << 1) | (chanB); @@ -272,7 +272,6 @@ } } prevState_ = currState_; - } float QEI::getRevolutions(){ @@ -286,6 +285,7 @@ float QEI::getDistance(float diameter) { + return getRevolutions()*diameter*3.1415926; }