Case 15 - Land Raider avoids obstacles

Part 1  Objective

After you upload the program, Land Raider goes straight forward. When it encounters an obstacle, it turns left or right randomly. After it runs away from the obstacle, it continues to go forward.

mr62.gif

Part 2  Preparation

  • Assembled Land Raider x 1

  • USB cable x 1

  • Computer with network access x 1

  • Connect the ultrasonic sensor to Port 6 on Auriga

Connect mBot Ranger to the computer by using the USB cable, open mBlock 5 (PC client or web version), select mBot Ranger in the Device Library, select the Upload mode, and press the red button to turn on Auriga.

mr63.gif
mr64.gif

mr65.png

Part 3  Programming

mr66.gif

Part 4  Practice

With the ultrasonic sensor and track, Land Raider can run away from obstacles. Can you program the RGB LEDs for different lighting effects when Land Raider avoids obstacles?

Was this article helpful?
6 out of 6 found this helpful

Comments

0 comments

Please sign in to leave a comment.