Encoder icon indicating copy to clipboard operation
Encoder copied to clipboard

small extra feature?

Open alto777 opened this issue 2 years ago • 0 comments

I am happy to find what I went looking for, namely the rotary encoder done on a general timer interrupt.

I didn't see that the pushbutton enjoyed the same "attention", that is to say pressing and releasing it can be missed.

I was able to modify your code to set a flag when the button goes down. I added a wentDown function and also provided a clear Flag function. With

//***
  bool wentDown() { return downFlag; }
  void clearFlag()  { downFlag = false; }

and

  if (pDebouncer.isDebounced( pb, DEBOUNCE_COUNT) && _encoderButtonVL != pb) {
    _encoderButtonVL = pb ;

//***
    if (pb != lastPB) {
    	if (pb)
    		downFlag = true;
      lastPB = pb;
    }
  }

which could also have similar flag/reset for button going up... but I am not a C++ programmer, I've never been good at naming things and for all I know the code already provides a way to do this so...

I write here in case you'd like to add something along these lines to your object.

I'm OK with my modifications to your object and will use it. Very well done right, THX!

a7

alto777 avatar Mar 18 '22 15:03 alto777