How do I exit out of case '5' when I activate case '6'? I just cant seem to exit out of the loop. I have tried putting a break; inside of case '6' but that didnt seem to work.
case '5': //receive a '5' from serial com port and execute auto docking
while(1)
{
north =0;
south=0;
east=0;
west=0;
scanmovement();
for(index=0;index<7;index++)
{
getdirection(index);
}
arlomove();
obstacleavoidance();
}
break;
case '6': //receive '6' from serial com port and stop auto docking
//somethingsomething
//break out of while loop in case '5' when this is activated
break;
ifstatement.case '5':loop)? Because otherwise, you'll never reachcase '6':to terminate the loop.