(simple) Debouncing 2 button state machine

@blackbird78 am I to understand that you now appreciate the difference between when a button becomes pressed and is pressed? Do I need to explain that any more?

I don't know the library, but I can infer things from how you used it. I think you are referring to when I said in my reply #2:

That means each time the loop function goes round it detects the button being pressed and increments or decrements the state machine again for as long as you hold the button.

You understand that the loop function (they are called functions, not 'voids') goes round and round very fast, yes? So it gets to the bit where value1 and value2 are updated, here:

  int value1 = debouncer1.read();
  int value2 = debouncer2.read();

Then just after that you take action depending on whether the values are low or high. Shortly after that loop goes around again, checks the buttons, sees they are still pressed and does the same thing again. There is no memory of the fact that the action was taken last time for the same button press, so it gets repeated until you let go of the button. This is NOT a debounce problem, that's a separate issue (with similar but not the same symptoms). Debounce is about what happens in the first 20ms (roughly) of pressing the button.

@gcjr suggested 10ms delay. The use of delay comes up often in discussions on here (do some searching if you want to read the full debate, do pour yourself a pint of beer / glass of wine / other favourite drink before you start reading). I am firmly in the 'never use delay' camp, others don't agree. You have found for yourself what problems it causes with your concern over whether PID will work properly.

I will be next looking to see if I can potentially nest an if statement inside one of my states, for holding one button down, and tapping the other, to toggle between internal states, then exit to the next state upon release.

Something to consider, and I am not saying this is the right (or wrong) thing to do, if you have switch states you could have separate states for the button becoming pressed, being pressed and being released, this will be 2 or 3 states depending on exactly how you do it. One of those states will take the desired action and then immediately change the state to the next one. Might be worth playing with even if only to learn something.

I need to fix the switch case portion by removing it from my loop, and putting it in a void of it's own.

As already mentioned, they are called functions. The word to the left is the type of variable the function returns, with 'void' meaning the function does not return any variable.

Do you need me to clarify anything else?