sources and files for the bombatuino project
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
/**
* @file bombatuino_ROTARY_ENCODER.h * * @author Lukas Haubaum (lukas@haubaum.de) * * @date February, 2013 * * @brief arduino library for handling a rotary encoder (simplified) * * library is for specialiced use: increment- and decrement-functions are called on change of pin A. * * */ #ifndef bombatuino_ROTARY_ENCODER_h
#define bombatuino_ROTARY_ENCODER_h
#if !defined(XcrementFunction)
/**
* callback function * * @param address * @param pin * @param value */ typedef void (*XcrementFunction)(void); #endif
class ROTARY_ENCODER { public: /**
* constructor * * @param increment function * @param decrement function */ ROTARY_ENCODER(XcrementFunction incrementFunction, XcrementFunction decrementFunction); /**
* set the value of pin B * * @param value of B-pin */ void setPinB(int value); /**
* set the value of pin A * * @param value of A-pin */ void setPinA(int value); private: int _pinA; int _pinB; int _oldA; XcrementFunction _increment; /**< increment function */ XcrementFunction _decrement; /**< decrement function */ void onPinChange(); };
#endif
|