hctl 2032 encoder for stm32
EncoderCounter.h
- Committer:
- c128
- Date:
- 2014-09-05
- Revision:
- 4:d99e7d8ed0be
- Parent:
- 3:b83ec916ba01
File content as of revision 4:d99e7d8ed0be:
// 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