Increment in switch statement not working No matter how I rearrange this, the increment compare always returns false....

I have even taken it out of the if, and put it in its own if:

int buttonFSM(button *ptrButton)
{ 
    int i;
    i = digitalRead(ptrButton-&gt;pin); 
    switch(ptrButton-&gt;buttonState)
    {
    case SW_UP:
        if(i==0 &amp;&amp; ++ptrButton-&gt;debounceTics == DBNC_TICS) //swtich went down
        {
            ptrButton-&gt;buttonState = SW_DOWN;
            ptrButton-&gt;debounceTics = 0;
            return SW_TRANS_UD;       
        }
        ptrButton-&gt;debounceTics = 0;
        return SW_UP;
    case SW_DOWN:
        if(i==1 &amp;&amp; ++ptrButton-&gt;debounceTics == DBNC_TICS) //switch is back up
        {
            ptrButton-&gt;buttonState = SW_UP;
            ptrButton-&gt;debounceTics = 0;
            return SW_TRANS_DU;       
        }
        ptrButton-&gt;debounceTics = 0;
        return SW_DOWN;   
    }
}
Looks to me like the path where the if doesn't happen are getting you. You don't show what DBNC_TICS is set to, but I'm assuming it's > 1.

ptrButton->debounceTics will never be greater than 1 because you always:

    ptrButton-&gt;debounceTics = 0;