Let’s get ready to code your Autonomous Delivery Robot project. To follow the coding tutorial on Makecode, click the Start Coding button below.

Open Coding

If you’d like to try coding your Wind Turbine without following a tutorial, you can code openly in the traditional Makecode workspace by clicking the link below.

Here’s a brief description to help you on your open coding journey:

Objective: To follow the path designed or laid out by the user, use the sonar to stop, and stop and stop driving, use the A and B buttons to start and stop the Robot driving.

We’re going to create code for a Autonomous Delivery Robot that lets it follow a black line on the ground all by itself. Here’s how we’ll do it: Using the line sensors that can see the difference between black and other colors. At the beginning, we’ll set the robot’s wheels to start moving straight so it’s all set to follow the line.

As the robot moves, if all its sensors see the black line, it will keep going forward slowly to stay right on the line. But if it starts to drift off and one of the sensors spots a different color, the robot will smartly turn a bit to get back on the black line and then stop for a quick second to figure out where it is.

We’ll also make it so you can stop the robot by pressing the A button and start it again with the B button. Plus, if there’s something in the robot’s path, it will stop moving and beep to let us know it found something in its way.

Our goal is to have the robot cleverly follow the line by changing direction when needed and stopping for obstacles, making it look like it’s moving on its own following a path we choose.