I don't even know how to call it, but I can't find my questions on the internet or in this forum. Hopefully somebody knows how to help me.
I'm trying to decide which integer to use by sending the value over an serial-connection. So what I have is a couple of state's:
int State01 = 0; int State02 = 0; int State03 = 0; int State04 = 0; int State05 = 0; int State06 = 0; int State07 = 0; int State08 = 0; int State09 = 0;
If I send information like "Switch01On" or "Switch02On", I would like to use the numbers 01 or 02 to decide which 'state' must be changed to '1'.
Is this even possible without a long list of if and else's?
Already thank you for the help!