How to create objects with their own variables?
I was tempted to re-write your code (I am quite rusty on c++), but you may be better to start with an existing class. 

There is a Button class on the Arduino site. See https://playground.arduino.cc/Code/Button

You could use this or study to see a more usual c++ implementation and adapt your code.

Virtually ALL c++ classes include a constructor. I would use instead of SetupButton

void button::button(int pin) {
  this-&gt;_pin=pin;
  pinMode(pin, INPUT_PULLUP);
}


and add uint8_t previousReading; and unsigned long time; to your class as private variables.