Chris Styles
/
EA_RotaryEncoder
This example positions a lit LED in the I2C LED array using the rotary encoder
RotaryEncode.h
- Committer:
- chris
- Date:
- 2010-03-02
- Revision:
- 0:498b9b4a7bb9
File content as of revision 0:498b9b4a7bb9:
/* Rotary Encoder * (c) 2009, cstyles */ #ifndef ROTARY_ENCODE_H #define ROTARY_ENCODE_H #include "mbed.h" #define R_W 0 #define R_L1 1 #define R_L2 2 #define R_L3 3 #define R_R1 4 #define R_R2 5 #define R_R3 6 class RotaryEncode { public: RotaryEncode(PinName A, PinName B); int read (void); protected: BusIn _rotary_in; Ticker _ticker; void _ticker_handler (void); int _position; int _state; int _e; }; #endif