07ObstacleAvoidanceCar
Introduction:
Create an obstacle-avoidance car using TabbyBot's ultrasonic sensor.
Objectives:
- Master the usage of the ultrasonic sensor.
- Master the programming logic for the obstacle-avoidance car.
Code:
https://makecode.microbit.org/S18373-61152-77390-63144
Program Logic:
- When the ultrasonic sensor detects a distance greater than 15CM, the car moves forward.
- When the detected distance is less than 15CM, the car moves backward and then turns.
Actual Result:
Press the A button to start the car.