Introduction: CoDrone Mini With Blockly: Flight Directions
Your CoDrone Mini can do way more than just take off and land. In this lesson, you'll learn how to program your CoDrone Mini to move up, down, forwards, backwards, and side to side. You'll also program it to fly in a shape!
- CoDrone Mini, remote, and USB cable
- Computer with internet to access https://robolink.com/blockly-cdm/
- CoDrone Mini batteries and chargers
Step 1: Teacher Resources
Click here for this tutorial's lesson plan, PDFs, and more!
Step 2: Flight Directions
Air vehicles move a little differently than land vehicles. While land vehicles can move forward, backward, and sometimes side-to-side, air vehicles can do all of that and move up and down! There are two blocks in the flight commands menu in Blockly that can help you program your CoDrone Mini to fly in any of these directions.
Step 3: Go for a Certain Amount of Time
One of the blocks you can use will make your drone move in the direction you pick for a certain amount of time. All you need to do is drag the go _ for _ seconds block from the flight commands menu to your workspace, pick your direction from the drop-down menu, and then type in the seconds you want your CoDrone Mini to travel for. The default power for this block is set to 50%, which means that it will fly at 50% of the CoDrone Mini's full speed.
Step 4: Go for a Certain Amount of Time...now With Power!
If you know how fast (or slow!) you want your CoDrone Mini to go, you can use a different block! Select the go _ for _ seconds at _ % power block from the flight commands menu, and then use the drop-down menu to pick your CoDrone Mini’s direction. Type in your CoDrone Mini’s flight time as well as the power value. This number can range from 0 to 100, with 0 being completely still and 100 being very fast. We recommend starting at 50 and seeing what you need to do from there.
Step 5: Turn for a Certain Amount of Time
In addition to being able to fly up, down, left, right, forward, and backward, your CoDrone Mini can also turn left and right! The turn _ for _ seconds at _ % power block allows you to control how much time your drone spends turning. Drag it to your workspace, and then pick left or right from the drop-down menu. Type in the number of seconds you would like your CoDrone Mini to turn for, and then type in the power value. This number can range from 0 to 100, with 0 being completely still and 100 being very fast. We recommend starting at 50 and seeing what you need to do from there.
Step 6: Put It All Together!
Try writing a program that will have your CoDrone Mini take off, fly forward, and then turn before landing! It could look something like the example code in the image.
Step 7: Challenge
Have your CoDrone fly in a shape (triangle, quadrilateral, pentagon, hexagon, octagon, etc.) using all of the commands you just learned! The only rule is that you HAVE to include a kill switch.