hctl 2032 encoder for stm32
EncoderCounter.h
- Committer:
- c128
- Date:
- 2014-09-05
- Revision:
- 1:6cab31aea0b8
- Parent:
- 0:b1faec368b5d
- Child:
- 2:3e4d1297e260
File content as of revision 1:6cab31aea0b8:
/* porting stm32 http://www.robogaia.com/two-axis-encoder-counter-mega-shield-version-2.html /* by Paolo Della Vedova /* there are more problem to convert 5v to 3v #ifndef HCTL_2032_DRIVER #define HCTL_2032_DRIVER #include "mbed.h" //*** arduino compatibility #define HIGH 1 #define LOW 0 #define digitalWrite(x,y) x=y class ENCODER { public: ENCODER( unsigned char countMode=4 ); void XAxisReset( ); int XAxisGetCount( ); void YAxisReset( ); int YAxisGetCount( ); void switchCountMode( unsigned char countMode ); private: signed int countEnc; unsigned char busByte; signed char busByteMSB; }; #endif