top of page

Chapter11   The Success Road

Line-patrollingSensor  Module

1541840407153.jpg

按住空格鍵,然後mBot運行該程序,判斷mBot是否完全沿著黑線。 

如果是,它會直線移動,否則,它繼續判斷mBot是否在左側,如果是,則轉向右,並使mBot返回黑線,反之亦然。

如果mBot遠離黑線,它將回退到黑線,像這樣重複循環,直到釋放空格鍵。

Hold down the spacebar and then mBot runs the program. Judge whether mBot is completely along the dark line. if it is, it moves straightly. Otherwise, it continues to judge whether mBot is on the left (right). If it is, it

turns to the right (left) and make mBot return to the black line. If mBot is away from the black line, it will draw back to the black line.

Repeat the cycle as this until you release the spacebar.

Untitled Diagram.jpg
bottom of page