bounce library 5 click 1 button function?

info:
SSD1306 i2c 128X64 display using u8glib
1 pushbutton
I get unexpected results using the clickbutton.h library because you aren’t supposed to use delay()

I came up with this code and it’s working as expected, but I’m by no means, a programmer. Would just like someone to verify if my logic is good. If I’m on the right track, then I’ll try to implement the display portion.

#include <Bounce.h>

const int buttonPin = 7;
Bounce pushbutton = Bounce(buttonPin, 10);  // 10 ms debounce

void setup() {
  pinMode(buttonPin, INPUT_PULLUP);
  Serial.begin(9600);
  Serial.println("Pushbutton Bounce library test:");
}

unsigned int count = 0;            // how many times has it changed to low
unsigned long countAt = 0;         // when count changed
unsigned int countPrinted = 0;     // last count printed

void loop() {
  if (pushbutton.update()) {
    if (pushbutton.fallingEdge()) {
      count = count++;
      countAt = millis();
    }
  } 
  else {
    unsigned long nowMillis = millis();
    if (nowMillis - countAt > 750) {
      switch (count) {
      case 1:
        Serial.print("Screen On!");
        count=0;
        break;
      case 2:
        Serial.print("Invert Display");
        count=0;
        break;
      case 3:
        Serial.print("Screen Off!");
        count=0;
        break;
      case 4:
        Serial.print("Rotate 90");
        count=0;
        break;
      case 5:
        Serial.print("Rotate 270");
        count=0;
        break;            
      }
    }
  }
}
      count = count++;

count++ increments the value in count. So, it is equivalent to count = count + 1. So, your code is equivalent to

count = count = count + 1;

Looks a bit odd written that way, doesn't it?

What is supposed to happen when count is 0?

count = count++;
************************
count = count + 1;

I tried the code with both of these, and they both worked. I just though the ++ option looked "cleaner". Guess aesthetics should take a backseat.

I have to add more code for other things to do while there aren't any button presses. So, nothing happens with 0 button presses.

I just though the ++ option looked "cleaner". Guess aesthetics should take a backseat.

The point was that:

count++;

is all that is needed. And THAT looks cleanest!

PaulS:

      count = count++;

count++ increments the value in count. So, it is equivalent to count = count + 1. So, your code is equivalent to

count = count = count + 1;

Looks a bit odd written that way, doesn't it?

What is supposed to happen when count is 0?

Actually, it's worse than that. That code shouldn't work at all, because variable++ returns the value before incrementing. So it's effectively equivalent to count = count. Count shouldn't be incrementing at all.

PaulS:

I just though the ++ option looked "cleaner". Guess aesthetics should take a backseat.

The point was that:

count++;

is all that is needed. And THAT looks cleanest!

I see what you did there.

count++

so much cleaner. Thanks!