Setup

Safety Tips

  • Always maintain sufficient safety distance between drones and people.

  • Never touch a drone when its propellers are spinning.

  • In case of emergency, use the red parachute button to cut off power.

Intro to Flying

Overview

  • Program a drone to take off, flip multiple times, and land.

Objectives

  • Become familiar with visual programming.

  • Program a drone to fly using basic motion commands.

  • Learn the coding concept "loop": a control statement for specifying iteration which allows code to be run repeatedly.

Steps

Create a Drone Project

  • Create a new drone project by tapping + New Project via "MY PROJECTS". Choose the template that matches the model of your Parrot drone. Here we use the Parrot Airborne Night as an example.

Connect to the Drone

  • Power on the drone, and wait until its eyes are steady green (about 30 seconds).

  • Your drone should automatically be detected and shown in the "Available Devices" dialog. Tap on it to connect.

    • Note: Swipe left/right if you have multiple drones.

    • Tip: If your drone is powered on but not automatically detected, tap on the drone icon to show all available devices and for more tips on troubleshooting.

  • The drone will show a battery status icon if it's successfully connected. Please charge the drone whenever the battery status becomes red, because the drone may stop responding to your commands.

Let's Fly

  1. Let's review blocks in the new-created document before we start to fly.

    1. :the blocks attached to this block start to execute after tapping the Play button of Tickle.

    2. : make the drone take off, which takes about 4 seconds to complete.

    3. : flip forward.

    4. : land the drone.

  2. Please make sure there are at least 2 meters of open space around the drone

  3. Press the green Play button to start flying.

Make the drone flip 5 times.

  1. Let’s add a total of 5 flip blocks.

  2. Press the green Play button to see the drone flip 5 times.

    • Tip: If your drone won't flip for multiple times, try adding a "Wait for 1 secs" block between each flip command.
  3. Instead of using 5 flip blocks, try adding the block Repeat 5 times with a single flip block inside.

  4. In programming, a loop is a control statement that allows code to be executed repeatedly. In Tickle, any block whose label begins with "forever" or "repeat" is a looping construct.

Flying Time, Speed, and Distance

Overview

  • Program a drone to fly forward at a particular speed for a specified duration to a target, then backward to the origin where it started.

Objectives

  • Program a drone to fly at different speed and duration settings, in order to fly a specific distance.

  • Related Physics concepts:

    • Linear relationship between speed, time, and distance

    • Velocity is a vector describing speed value with a direction

Steps

Create a Drone Project

  • Create a new drone project by tapping "+ New Project" via "MY PROJECTS". Choose the template that matches the model of your Parrot drone. Here we use the Parrot Airborne Night as an example

Fly Forward and Backward

  • Use the block in the Motion category Set speed to 30 % to set the flying speed after taking off. You can change the speed by tapping on the numeric value.

  • Use the block in the Motion category, move forward for 1 secs to set the moving direction and the duration. You can choose a direction from the pull-down menu to fly forward, backward, left, and right.

  • Now, let's make the drone fly forward, flip, then fly backward. The drone should return to its original starting location after executing all the commands. The program should look like the following:

  • Let's start flying by tapping the green Play button!

Let’s do more: Relationship between Speed, Time, and Distance

  • Program the Parrot drone to fly a specific distance by changing its speed and flying duration. To fly twice the distance, you can double the speed setting, for example, from 50% to 100%. Another way is keeping the speed the same, but doubling the flying time.

  • In Physics, distance = speed x time. Velocity is a vector physical quantity; both magnitude and direction are required to define it. The scalar absolute value (magnitude) of velocity is called "speed".

Challenge

  • Set a target landing zone and program the drone to fly and land in the that zone. Try adjusting the speed setting to 25% and 50% and see how much flying time is needed to reach the target landing zone.

  • Discussion: if you want to fly to the target zone in half of the time, how should the speed setting be adjusted?

Fly in a Square and Triangle

Overview

  • Program a Parrot drone to fly along a square and a triangular route, by turning to specific heading angles and flying.

Objectives

  • Understand heading angles (0 to 360 degrees).

  • Combine turning blocks and motion blocks to turn the drone to the proper headings for flying in a square and triangle pattern.

  • Use repeat loops to fly in the same pattern using fewer code blocks.

  • Learn about the geometry concept "exterior angles".

Steps

Create a Drone Project

  • Create a new drone project by tapping + New Project via "MY PROJECTS". Choose the template that matches the model of your Parrot drone. Here we use the Parrot Airborne Night as an example.

Turning a Complete Circle

  • Heading angle is the angle that the drone is facing or pointing.

  • The figure below shows heading angles at 90-degree increments. To turn a full circle, a drone has to turn its heading angle for a total of 360 degrees.

Fly in a Square Route

  • Use the block in Motion category, turn right by 90 degrees, to turn the heading angle of the drone by a specified angle.

  • The following blocks move the drone in a square:

Understanding the Components of a Square

  • Notice that the drone has made a complete square by turning 4 times, turning a total of 360 degrees to return to its original heading. The degrees to turn each time is 360 degrees divided by 4, which is 90 degrees.

Fly in a Square Route using repeat Loops

  • A repeat *n* times loop is used when the number of iterations can be calculated and known in advance. In our case for flying along a square route, the same blocks (move forward for 2 secs and turn right by 90 degrees) will be performed 4 identical times. Therefore, we can use the block repeat 4 times to replace the redundant blocks, and the program would look like this:

Program the Drone to Fly in a Triangle

  • To fly in a triangle, the drone has to turn 3 times to complete a full 360° turn. The number of degrees to turn each time is then 360° divided by 3 = 120° .

  • The program should look like this:

Challenges: Fly in a Pentagon (5 sides) and a Hexagon (6 sides)

  • Calculate the degrees to turn each time by dividing 360° by the number of the sides of the geometric shape. The following in an example program for the Pentagon:

  • In geometry, an angle of a polygon is formed by two sides of the polygon that share an endpoint. An exterior angle (or external angle) is an angle formed by one side of a simple polygon and a line extended from an adjacent side. This is the turning angles that you’ve been calculating throughout this lesson.

    • The sum of all exterior angles of a polygon is 360°, and each exterior angle of a regular polygon is 360° divided by the number of sides.

Pilot a Drone using Motion Sensors

Overview

  • Write a program to use the motion sensors in your phone and tablet to pilot a drone. For example, program the drone to fly right when the iPad is tilted right, fly forward when tilted forward, etc. When the iPad is shaken, the drone can perform a flip in mid air!

Objectives

  • Use motion sensors in smartphones and tablets to sense motion events (tilt and shake) to pilot a drone.

  • Understand the programming concept of "event-driven programming".

Event-driven Programming and Event Blocks

  • Event-driven programming is a computer science concept in which the flow of a program is determined by events such as sensor input, user actions (like touching the screen or tilting the device), and messages from other programs.

  • It is the dominant paradigm generally used in modern application like graphical user interfaces (GUI) and web-pages that performing certain actions in response to user input.

  • A simple way to think of it is "When something happens, do something". For example, "When it rains, open your umbrella."

Steps

Create a Drone Project

  • Create a new drone project by tapping + New Project via "MY PROJECTS". Choose the template that matches the model of your Parrot drone. Here we use the drone Night as an example, but you can connect to any of the drones that Tickle supports.

Fly a Drone Forward using Motion Sensors

  • Under the Events category, add the motion sensing event block When iPad is tilted forward like the following:

  • Let's start flying by tapping the play button. You will discover that if you tilt the iPad forward, the drone will move forward for 2 seconds. Otherwise it will hover at its current position. You can land the drone by tapping the red Stop button.

Use Motion Sensors to Fly the Drone in Different Directions

  • To pilot the drone to fly in all four directions, add a When … tilted … event block for each direction. Also, add a When … Shaked … event block to flip the drone!

FAQ and Troubleshooting

  • Why can't my drone connect to Tickle?

    • Only one app can connect to a drone at a time. If you are using Parrot’s Freeflight 3 app, make sure to disconnect your drone by tapping the menu icon and then selecting your drone.

    • Only one iOS device can connect to a drone at a time. Double check that this drone is not connected to another iPad/iPhone/iPod Touch.

    • Toggle Bluetooth OFF for 5 seconds, then turn it back ON in iOS Settings.

    • Restart the drone by removing and re-inserting its battery, and wait till its eyes are steady green.

    • Create a new drone project that matches the model of your drone (e.g. )

    • If you are in the project, but yourr drone is not automatically detected by Tickle, tap on the drone thumbnailicon at the top to view all available drones.

  • Which iOS devices can I use to program Parrot drones?

    • iPad: iPad 3 and newer, all iPad Air and iPad mini models.

    • iPhone: 4s and later

    • iPod Touch: 5th generation

  • How do I connect to more robots, drones, and other devices?

    • You can connect to more devices and also virtual characters via the + Add button in any project.

    • Only one Parrot quadcopter can be connected to Tickle at a time, but you can add other Parrot mini drones like Jumping Race, and many other devices like Star Wars BB-8 Droid, Sphero, Dash & Dot, Philips Hue, and Light Blue Bean (Arduino).