hi tnx for your answer. This code is for my robot it makes me able to control it from my phone true bluetooth. But i had an ide of making a funktion that makes it go for it self via a sonar sensor. But the problem is that the first funktion where i control manualy is looking after a command from the bluetooth or else it continues spaming M_stop(it the comand for stoping the motors) which is interfering with my code for the detection with sonar sensor. Thats why i was wondering if it was possible to switch between 2 loops. or there is possible another solution to my problem that i havent tought of.