Trying to advance through multiple messages on a 16x2 LCD


I am trying to step through message screens on a 16x2 display by pressing a single switch. I have tried using the switch case function but it looks like that function only allows for two different conditions (three if the first two are not met). I have also tried to count the number of times the button has been pressed and then tried to equate that to the message that should be shown. For example, button = 1 show "Hello", button = 2 show "how are you", etc. So far I have not been successful. Should I try the break function next? I feel like I am over thinking this program. Any suggestions would be greatly appreciated. I am learning the different functions as I go but I am currently stumped on this one.


Check out the examples supplied with the IDE. Control->switchCase.

  switch (button) {
  case 1: 
  case 2:
    Serial.println("How are you?");
  case 3:
    Serial.println("That looks like a tasty candy!");
  case 3:
    Serial.println("Could I have one?");

Thank you for the advice! I felt like I was close but this helps a ton. Let's see if I can get this thing going.