hctl 2032 encoder for stm32

Dependencies:   FastIO

EncoderCounter.h

Committer:
c128
Date:
2014-09-05
Revision:
2:3e4d1297e260
Parent:
1:6cab31aea0b8
Child:
3:b83ec916ba01

File content as of revision 2:3e4d1297e260:

// porting stm32 http://www.robogaia.com/two-axis-encoder-counter-mega-shield-version-2.html
// by Paolo Della Vedova
// ther is 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