hello all, I was wondering what is the best way to test for multiple conditions, if or switch case.
I need to test for 42 separate conditions. each condition will do a separate statement. there will never be a combination of conditions. the condition will be 0 - 41. I don't think if statement will be the best way, but maybe. I hope I explained as simple as needed. - Thanks
conditions are simple - var=0 and so on. this variable is coming from visual studio. it will pass (var) to sketch and depending which value is passed it will execute a command to one of three servos.
gadgfreak:
it will pass (var) to sketch and depending which value is passed it will execute a command to one of three servos.
I have a feeling that if you were to tell us what you want to achieve somebody will suggest a much simpler solution than working through 42 IF or CASE statements.
sorry guys, after thinking about it more, the biggest chunk was in a function that had 30 options. Needed to take an input from 60 to 90 and multiply it out by 9 to end up with 0 - 270. Had a loss of brain function there for a bit. I reduced it down to 1 statement to do this.