Compare two string in a while loop

Your WHILE test looks very complicated.

Can you write a simpler sketch that just uses a single character and get that to work before moving on to longer character arrays.

And if I was writing that code I do the strncmp() separately from the WHILE so that I could print the result for debugging purposes.

Also you have char test_depart[] = "1111"; within the WHILE loop. That creates another variable of that name which is NOT the variable that is used in the WHILE test. You may not need that line at all. At the very least delete the "char" from it.

...R

PS I hadn't spotted the othe local defintions that @DavidOConnor mentions.