Skip to content

small extra feature? #7

@alto777

Description

@alto777

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions