1 #include "CbRotaryInput.h" 2 #include "MutilaDebug.h" 3 #include "CheeseboardConfig.h" 9 _button(buttonPin, false),
22 _position = _encoder.read()/4;
31 uint16_t tapDuration = _button.tapped();
32 if (tapDuration > 0) {
34 if (_buttonCb != NULL) {
35 _buttonCb(tapDuration);
39 int32_t newPosition = _encoder.read()/4;
40 if (newPosition != _position) {
41 int8_t diff = newPosition - _position;
42 if (_rotatyCb != NULL) {
43 _rotatyCb(diff, newPosition);
45 _position = newPosition;