Programming LCD display for swtching between inputs

Declare the state counter as an int. You can then increment it (and rollover) to your heart's content. The check for what state the input is at is then easy

if (state == 1)
{
  //do stuff here
}

This being C you can also give each state its own name to make it more obvious what you are testing for but walk before you run and include plenty of comments.

By the way, your button input really needs to be debounced or it will be unreliable but you have plenty of other things to do so I suggest that you put it on the 'to do' list and accept odd responses to buttons for now.