Introduction

One of mBot’s defaults programs allows it to detect and move around obstacles. In this activity, students learn how to recreate part of the obstacle-avoidance behavior using data from the Ultrasonic Sensor.

Objectives

  • Learn to how the Ultrasonic Sensor operates.
  • Use the output of the Ultrasonic Sensor to trigger events an mBot program.
  • Apply an understanding of the Ultrasonic Sensor to mimic the actions required of real-world autonomous vehicles.
  • Practice writing code and troubleshooting when problems arise.