driver for incremental encoder
Diff: decoder.h
- Revision:
- 6:2fdce74d2a7b
- Parent:
- 5:1a5772466668
--- a/decoder.h Thu Mar 14 16:05:28 2019 +0000 +++ b/decoder.h Thu Mar 28 16:28:55 2019 +0000 @@ -9,16 +9,7 @@ public: - - /* These values control the upper and lower limits the the count will go to change limits to suit application*/ - typedef enum{ - - - LOWER_LIMIT = 0, - UPPER_LIMIT = 19 - - - }limits_t; + decoder(PinName channelA,PinName channelB); @@ -26,6 +17,7 @@ int8_t getDirection(); int16_t getCount(); + void setLimits(int8_t lower, int8_t upper); void reset(); @@ -38,6 +30,9 @@ int8_t _direction; int16_t _count; + int8_t _lowerLimit; + int8_t _upperLimit; +