Hello,
Thanks for the reply.
I used your code and I also tried the following
In both cases I got the same problem which is reproducible.
(1) I press the green flag and run the scripts and it works fine
(2) I move the mbot back to the starting position to run them again
(3) I press the green flag to run them again and it stops immediately because the distance it measures is less than 10 (9.5 to 9.86 cm)
(4) I press the green flag and it runs fine
SO it seems that for some reason after it stops the mcore keeps the last value the sensor measured and it returns it the next time I try to get the distance.
I do not use the USB cable. I use the 2.4 GHz connection to control the mbot.
Do you have any problems with the mbot driving on a straight line. It does not move on a straight line even when I hold it on the air so it does not touch the floor, so it must be a problem with the motors or the gearboxes. One of the two motors seems to run slower than the other.
And a last question. Do you know where I can find documentation for the mbot extention blocks? Online or in pdf form.
Thanks again,
Napoleon Maou