Get back by 1/2 of distance


#1

Hello everyone!Me and my friend are studying at a class that teaches about mBlock.Every time they give us challenges/exercises to do.So Today They gave us a challenge to draw letter T and Z and that was good and easy but after that they told us to make it run forward for infinite time and when it sees obstacle it goes backward 1/2 the distance it ran forward without the seconds.


#2

Hi Peely,

Since this is probably to make you think, I will not give the code but hints. The problem works if the mBot comment at 400mm or less because the ultrasonic sensor has a maximum. The diagram I made is for a return to the initial location without the seconds and therefore not with a return 1/2 of the distance.

There you go … good luck …

Use the ultrasonic capture and stop when you have obtained the value you want


#3

Hi Peely,

Did you find the solution ?? Here’s one more clue …
Solution


#4

hmmmm…ill try