Ok so i have this project i really want to do. It involves three switches, two buttons, and a LCD Screen. What I want it to do is when it is turned on (meaning when I plug the 9v battery into the arduino) it reads the state of the three buttons and depending on the combination (see picture for combinations to each function) it will run one of the eight functions. I have two functions already made. The main thing I need help with is not making the functions but how to combine all of the functions into one "mega program" that can run all eight depending on the state of the buttons.
!(http://forum.arduino.cc/Users/cstar436/Desktop/Photo on 10-31-13 at 9.24 PM.jpg)
For example, one of the functions I have already made asks if you want to hear a joke and then randomly says a joke when you press the button. The other function says good morning and asks how you feel, and depending on you response (yes or no) it will say something to you, like have a nice day or cheer up.
snippet you need
int buttonstate = digitalRead(PIN1) << 2; // 0 or 4
buttonState &= digitalRead(PIN2) << 1; // 0 or 2
buttonState &= digitalRead(PIN3) ; // 0 or 1;
switch (buttonState) // can have 8 values from 0..7
case 0: // no button pressed;
case 1: sayHello(); break;
case 2: sayGoodbye(); break;
case 3: sayGoodbye(); break;
case 4: sayGoodbye(); break;
case 5: sayGoodbye(); break;
case 6: sayGoodbye(); break;
case 7: playNationalHymn(); break;