class Flasher
{
    // Class Member Variables
    // These are initialized at startup
    int buttonPin;      // the number of the button pin
    long debounce;


    // These maintain the current state
    int buttonState = 0;
    int lastbuttonState = 0;
    int mech_state = 0;
    unsigned long previousMillis;
    // Constructor - creates a Flasher
    // and initializes the member variables and state

  public:
    Flasher(int pin, int buttonState, int mech_state)
    {
      buttonPin = pin;
      pinMode(buttonPin, INPUT_PULLUP);


    }

    void Update()
    {
      buttonState = digitalRead(buttonPin);


      if (buttonState != lastbuttonState)
      {
        if (buttonState == HIGH)
        {
          if (mech_state == 0)

          {
            mech_state = 1;

          } else if (mech_state == 1)
          {
            mech_state = 0;
          }
          } else
          {
          }
          delay(50);
        }

        lastbuttonState = buttonState;
      }
    };


    Flasher pump1(2, buttonState, mech_state);
    Flasher pump2(4, buttonState, mech_state);


    void setup()
    {

    }

    void loop()
    {
      pump1.Update();
      pump2.Update();
    }
