mBot Blockly obstacle detection


Hi, my kid is doing mBot Blockly tutorial and we are stuck on Wait number 5.
It asks us to “Tell the mBot to move forward, and turn left for 1 second until there s obstacle ahead.”
This is what we wrote
“keep moving forward at the speed of 150”
“turn left 1 second at the speed of 150”
“wait until obstacle ahead”

No matter how we tried, it doesn’t pass. Is there anything wrong in the code or is it because the sensor isn’t working correctly?

I also see that my mBot is walking the wrong direction, When we wrote “move forward”, it’s actually moving backwards. Anyone know what happened?


Hi jct,

You probably have the motors reversed. For the code of number 5, I will look and send it to you during the day


I just have the screen print in French


Thanks. I checked switched the motor cable and it’s moving forward as expected!


Thanks! I tried the code and it passed. It seems that I didn’t understand the statement correctly. The description is confusing to me. But maybe it’s my problem. Thanks again!


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.