Ultrasonic sensor


#1

Please see “Challenge” in the bottom of webpage http://learn.makeblock.com/en/robot-kits/mbot/the-ultrasonic-sensor/

Can you put the code above together to make the completed program?

I don’t know what I should do for completing program.

Who can advise? Thank you.


#2

I believe you are being asked to write the program in mBlock using the example code. Remember that Scratch programs require a hat block (such as when [green flag] clicked]) to execute within mBlock.


#3

Thank you, Sir,

I made 3rd coding with 1st and 2nd code. On testing this, it is not bad.

One more question, how to rotate KIT 90 degrees exactly to the left / right ?
According to mBot Tutorials,
robot wasn’t turning enough when it encountered an object, so I added a wait (1 sec) command after the turn.

When we code, we have to adjust waiting time ???


#4

Hi funrobot,

Yes, you need adjust the waiting time if you want to make the physical robot turn a certain angle.


#5

The motors on the mBot do not have encoders, so as @tec_support mentioned all movement is based on time.


#6