Dragonman502:
I am writing a program that reads multiple sensors on the Analog input pins and because I don't really understand how to initiate the switch/case parameters I am using if statements. The sketch works fine when only using 2 IF statements but when I get to the third nothing works. I didn't think there was a limit to the number of IF statements but am I wrong? Each IF statement is exactly the same so it's not syntax errors or anything like that. I am at my wits end trying to get this to work. Please help with any input possible. In the mean time I will keep working on it. Thank you in advance for any input.
Auto Format is your friend! Or it should be.
Are we to assume that you're talking about the IF statements in loop() or are you talking about playfile(char *name)? And could you be anymore general than "nothing works"?
Your problem isn't IF statements or not using CASE statements. Your problem is one of your code having some kind of bug. Very hard for anyone to help when you're being so general and not giving specifics.
A good way to diagnose your problem is to put statements like the following inside your IF statements (as the first command).
Serial.println("1");
With each command being a different number, letter, or something to describe each IF statement. Then, when you run your sketch you open the Serial Monitor so you can track where the code is and when it's failing.
In any case, it's not the fault of Arduino and using too many IF statements or needing to use CASE. The problem is your code is wrong. And for us to help specifically you should give DETAILS.
Tim