Download the file
  1. #ifndef rotaryencoder_h
  2. #define rotaryencoder_h
  3.  
  4. #include <WProgram.h>
  5.  
  6.  
  7. class RotaryEncoder {
  8. uint8_t pina, pinb;
  9. static int8_t enc_states[];
  10. int8_t old_dir, dir;
  11. public:
  12. int8_t old_pins;
  13. RotaryEncoder(uint8_t a, uint8_t b);
  14. uint8_t read(void);
  15. };
  16.  
  17. #endif
  18. // vim:ft=arduino
  19.