Line following and obstacle avoidance Ultimate 2.0


Still a beginner at programming and I’m kinda stuck. The robot would just push the obstacle with it and not go back to follow the line (It’s supposed to follow a white line)

This is what I have so far…

Help please-


Because of the “Wait 0.5 seconds” block, the code cannot continue to run until the 0.5 seconds are expired. So, the mBot Ultimate can’t continue with its other codes until the 0.5-second delay is over. (This is because mBot Ultimate is based on an Arduino, which can’t multitask).

There are workarounds for this problem. If you’d like me to send you one, please let me know. :grinning:


Wait really :0? Can you send one please?


Sure! It may be a couple of days for me to make it, I’m really busy! :wink:


This is what the code looks like, if you want the file I can send it to you:


Can you send it via Google Drive, please?


Sorry, I don’t have a Google Drive:

You can download that and open it in mBlock.