different action based on the number of times a button is pressed

A somewhat different multi-press button example -

class push_button_t
{
    const uint8_t   _pin;
    const uint8_t   _transition_level;
    const uint8_t   _number_of_states;

    uint8_t         _press_counter;
    uint8_t         _earlier;

public:
    push_button_t(uint8_t pin, uint8_t transition_level = LOW, uint8_t number_of_states = 2)
        : _pin(pin)
        , _transition_level(transition_level)
        , _number_of_states(number_of_states)
        
        , _press_counter(0)
        , _earlier(0)
    {}

    void begin()
    {
        pinMode(_pin, INPUT);
    }

    operator uint8_t()
    {
        uint8_t now = digitalRead(_pin);
        if ( now != _earlier )
        {
            if ( now == _transition_level )
            {
                _press_counter++;
                _press_counter %= _number_of_states;
            }
        }
        
       _earlier = now;

       return _press_counter;
    }
};

class led_t
{
    const uint8_t     _pin;

public:    
    led_t(uint8_t pin) : _pin(pin)      {}

    void begin()                        { pinMode(_pin, OUTPUT); }
    
    uint8_t operator = (uint8_t rhs)    { digitalWrite(_pin, rhs); return rhs; }
    operator uint8_t ()                 { return ((LOW == digitalRead(_pin)) ? LOW : HIGH); }
};


const uint8_t   pinLED      = 33;   // chipKIT Basic I/O Shield LD1
const uint8_t   pinBUTTON   =  4;   // chipKIT Basic I/O Shield BN1

led_t           led(pinLED);
push_button_t   button(pinBUTTON, LOW, 4);

void loop()
{
    switch ( button )
    {
        case 0: led = 0;                    break;
        case 1: led = !led;  delay(125UL);  break;
        case 2: led = !led;  delay(250UL);  break;
        case 3: led = !led;  delay(500UL);  break;
    }
}

void setup()
{
    led.begin();
    button.begin();
}