Hi ,

i'm making a robot wich will have two mods automatic/manual , i will controll the robot with a laptop through bluetooth . i did program the two mods but to switch between them i need to wait until function of the mod finish , what i want is to be able to switch between the two mods anytime i want , i think the solution will be an interrupt, every time i send data through bluetooth it interrupt the current mod , but i can't figure out how to do it.

You more than likely don't need interupts and it will more than likely not solve your problem. Write non-blocking code.

Thank you for your reply , i found this method : i will use it in my code and see if it will work

You can also read and learn from Demonstration code for several things at the same time.

thank you a lot that really help me and solved my problem