In order to make the mBot stop when he finds an obstacle, we use the ultrasound sensor, placed in the eyes of the robot: one eye is the ultrasound transmitter (indicated by the letter T), whereas the other one is the receiver (indicated with the letter R). The ultrasound sensor allows us to let mBot know the distance of the object in front of him, without touching it. The transmitter emits an ultrasound signal, which is reflected by the object and goes back to the receiver. By measuring the intervalLEGGI TUTTO

In order to steer mBot, first of all we must teach him to stop, otherwise as soon as he starts moving, we lose control. We simply tell him that, when we press the spacebar (for example) he must go forward at zero speed. Then we make sure that, when this happens, all the lights are off. At this point, by always using the command when you press that button we tell him how to move, according to the key pressed: up arrow to go forward,down arrow to go back, rightLEGGI TUTTO