You have a fair few unnecessary pairs of braces, that confuse things a little. (They won't be causing problems, though, except for readability.)
These won't be helping:-
if (buttonStateL == HIGH);
.
.
if (buttonStateR == HIGH);
(Lose the semi-colons from the ends.)
Incidentally, if you hit Ctrl-T in the IDE to auto-format, those errors become immediately apparent because the following lines aren't indented.
Anyway, fix them, then see if your program does what you want. Let us know if there's still a problem.
Edit: I just spotted these. They won't be helping, either:-
lastButtonStateL == buttonStateL;
lastButtonStateR == buttonStateR;
I guess you meant:-
lastButtonStateL = buttonStateL;
lastButtonStateR = buttonStateR;
Edit2:
Also, I notice that the layout of these two is different:-
if (buttonStateL != lastButtonStateL)
{
if (buttonStateL == HIGH)
buttonPushCounterH++;
} // Increment Count by 1
Serial.print("Button has been pressed ");
Serial.print(lastButtonStateL);
Serial.println(" times");
delay(150);
if (buttonStateR != lastButtonStateR) // if SW2 is pressed perform action described in loop
{
if (buttonStateR == HIGH)
buttonPushCounterH--; // Decrement Count by 1
Serial.print("Button has been pressed ");
Serial.print(lastButtonStateL);
Serial.println(" times");
delay(150);
}
In the first, did you mean to put the serial prints and delay inside the braces, like in the second?
(Yet another argument for using Ctrl-T. It would have made this stand out more.)
Oh and in the second of the last two conditionals that I quoted, you have:-Serial.print(lastButtonStateL);but I think you meant:-Serial.print(lastButtonStateR);
I think I'm done now. ![]()