String x; is not valid, string x; is, C is case sensitive
if(x ==('1 to 2'))
change to
if(x == "1 to 2")
likewise
if(x ==('2 to 2'))
if(x =="2 to 2")
see what happens
even if it works its a pretty wasteful way to do it, but hey! whatever works for now until you get a grasp on the language
int pos; pos<2;pos++;
not sure whats going on there, what your looking for is something like
for(int pos; pos < 2; pos++)
{
do something
}
if I were a betting man you have knowledge of BASIC right? if so toss it out the window, there is only one language that works like BASIC
PS I am not even sure the above will fix all your issues, serial read, like every other known uart buffer in history fetches one charater at a time so to build a string out of single characters might be more of a pain in the butt than worth it. given the letters A-Z and numbers 0-9, gives you 36 unique values at a very simple level of understanding ... 0-9 = 1-10, A-Z= 11-26... something to think about, I have used it before (base 36) with great results.