Quadrature encoder interface library.
Dependents: EX_encoder_qei_hukeqin EX_encoder_PID_QianYuyang EX_encoder_PID_QianYuyang EX_encoder_PID_QianYuyangV2
Diff: QEI.h
- Revision:
- 1:d45b9d85b9a4
- Parent:
- 0:5c2ad81551aa
diff -r 5c2ad81551aa -r d45b9d85b9a4 QEI.h --- a/QEI.h Thu Sep 02 16:48:55 2010 +0000 +++ b/QEI.h Tue Apr 09 06:54:47 2019 +0000 @@ -207,7 +207,8 @@ * @return Number of revolutions which have occured on the index channel. */ int getRevolutions(void); - + + int getState(void); private: /** @@ -235,7 +236,8 @@ int pulsesPerRev_; int prevState_; int currState_; - + int state_; + volatile int pulses_; volatile int revolutions_;