Today we will go through the DroneBlocks Simulator to help us learn about block-based coding and how we can use it to fly our drone. A simulator shows you what something will look like in real life before you do it in real life. We like to use a simulator for our drones to map out what we want to happen before we fly our drones. This helps us because we can see potential problems, and it doesn’t waste the battery on our drones. You will do a few challenges today and learn about loops in DroneBlocks.
Loops are an essential part of coding and used all of the time. A loop block can also be called a repeat block, too. A loop is doing something over and over again and this can be extremely helpful when writing out your coding. Today we will learn how to use a loop in the simulator. Below is the introductory video to loops and they refer to the block as a repeat but remember, they mean the same thing. After that, we will work on the simulator.
Now we will practice loops in the simulator. Follow the steps below or watch the video to see how to add a loop to your program.
We will take what we have learned and use the DroneBlocks App to test our drone. Use the code from the DroneBlocks simulator from earlier as a guide. Use the DroneBlocks app on your device and copy the code from the simulator. When you are ready and can safely fly, launch your code.