Rotary encoder library. Add: void setInterval(timestamp_t t) for Nucleo F401RE
Fork of RotaryEncoder by
Diff: RotaryEncoder.h
- Revision:
- 4:7a50a5d3682c
- Parent:
- 3:6736c3bf48c9
- Child:
- 5:60c44df48016
--- a/RotaryEncoder.h Wed May 25 01:08:22 2016 +0000 +++ b/RotaryEncoder.h Sun Jun 12 08:48:43 2016 +0000 @@ -71,13 +71,24 @@ /** * Get the value. * - * @param The value. + * @return The value. */ int getVal() const { return val; } /** + * Set the value. + * + * @param The value. + */ + void setVal(int _val) { + if (min <= _val && _val <= max) { + val = _val; + } + } + + /** * Set the ticker interval. * * @param The interval in microseconds.