Introduction To Coding Drones!

CoDrone and Blockly

Level 1- Introduction

Introduction to Coding Drones!

  • I.) Drone Overview and Calibration

    CoDrone EDU:

    Target Audience: Designed for educational use, ideal for students and classrooms.

    Features:

    Programmable via block-based coding (Blockly) and text-based coding (Python). Includes an educational curriculum with lessons and activities. Sensors for altitude hold, optical flow, and range-finding. Easily integrates into STEM and computer science programs.

    CoDrone Pro:

    Target Audience: Suitable for individual learners and hobbyists.
    Features:

    Programmable using block-based coding (Blockly) and Arduino. Includes remote controller for manual flight. Sensors for altitude hold and optical flow. Focus on hands-on learning and drone programming.

    Both drones emphasize coding and hands-on learning but cater to slightly different audiences and coding platforms.

  • II.) Introduction to BLOCKLY

    Teaching about drone delivery involves exploring the technology and mechanics behind delivery drones, including their components, flight mechanics, and autonomous versus remote-controlled systems. It covers the regulations and safety protocols that ensure compliance with FAA rules and protect privacy and public safety. Logistics and infrastructure are discussed, focusing on efficient route planning, designated landing zones, and integration with traditional delivery methods. Applications and use cases demonstrate the practical benefits in sectors like e-commerce, healthcare, and industrial uses. Finally, the discussion includes the challenges and future developments in the field, such as technical limitations, legal and ethical issues, and innovations like swarm technology and AI advancements. This comprehensive approach equips learners with a thorough understanding of the current state and potential future of drone delivery systems.

  • III.) Flight Commands

    CoDrones (by Robolink) offer a variety of flight commands to control their movements and behaviors. These commands include:

    Basic Flight Commands: Take off, land, hover, and control altitude.

    Directional Controls: Move forward, backward, left, and right, as well as rotate (yaw) in either direction.

    Advanced Maneuvers: Perform flips, set specific flight paths, and execute complex flight patterns.

    Sensor Integration: Use built-in sensors to follow lines, avoid obstacles, and maintain stability.

    Programming Integration: Utilize coding platforms like Blockly, Python, and Arduino to program and automate drone behaviors.

    ONLY THE BASICS WILL BE COVERED In THIS MODULE

    For more details, visit the Robolink CoDrone documentation.

  • IV.) Conditionals & Variables

    CoDrones by Robolink utilizes conditionals and variables to enhance programming and flight capabilities.

    Conditionals:

    If-Else Statements: Execute different actions based on specific conditions, such as sensor readings or flight status.

    Loops with Conditions: Repeat actions while certain conditions are true, enabling continuous monitoring and responsive behavior.

    Variables:

    Data Storage: Store information such as sensor data, flight parameters, or user inputs.

    Dynamic Control: Adjust drone behavior dynamically by modifying variable values during flight.

    These elements allow for more complex and responsive drone programming, fostering an interactive learning experience.

    For more details, visit the Robolink CoDrone documentation.

  • V.) Loops & LEDs

    Loops are essential for executing repetitive tasks in programming, improving efficiency, and automating processes.

    Drone LEDs play a critical role in navigation, safety, and visual communication, enhancing the overall functionality and usability of drones.

I. Drone Overview and Calibration -

  • “A journey of a thousand miles begins with a single step.” —Lao Tzu

  • The Gyro and Accelerometer
    Gyro (Gyroscope):

    • Measures the rotational movement of the drone.

    • Helps maintain stability and orientation.

    • Ensures smooth and controlled turns.
      Illustration:

      • Imagine spinning in place and then trying to stop suddenly. Your body would naturally try to stabilize itself to prevent falling. The gyroscope in a drone does something similar, detecting rotational movements to keep the drone steady.

    Accelerometer:

    • Measures the drone's acceleration in different directions.

    • Detects changes in speed and direction.

    • Helps maintain level flight and detect tilting or shaking.

      Picture yourself in a car that suddenly accelerates. You feel pushed back against the seat. The accelerometer in a drone senses this kind of movement, detecting changes in speed and direction to help keep the drone level and balanced.

  • Remove the Battery:

    1. Pop out the battery from the drone.

    2. Reinsert the Battery:

    3. Press the Button:

      • Flip drone upside down.

      • Hold down the small button on the side of the drone.

    4. Wait for Lights:

      • Watch for the lights to change (usually purple, white, then green), indicating calibration mode.

    5. Release the Button:

      • Release the button once the lights indicate calibration is in progress.

      • place the drone on that flat well lit surface!

  • CoDrone Safety Steps Summary

    1. Avoid Grabbing from the Top:

      • Do not grab the drone from the top to prevent propeller injuries.

    2. Secure Long Hair:

      • Students with long hair should tie it into a ponytail to avoid tangling.

    3. Hair Removal from Propellers:

      • Remove the battery, lift the propeller, and untangle the hair.

    4. Propeller Orientation:

      • Ensure propellers are correctly positioned based on markings.

    5. Avoid Water:

      • Do not fly the drone near water to prevent damage.


        If using REMOTE Handle Bluetooth Module Gently:

      • Treat the Bluetooth module with care to avoid damage.

    Managing CoDrone in a Classroom Setting

    1. Pre-Class Preparation:

      • Review and test the code you'll be using.

      • Ensure CoDrones, laptops, USB cables, and batteries are ready.

    2. Classroom Setup:

      • Divide the room into sections for programming and flying.

      • Have multiple batteries charging.

    3. Student Preparation:

      • Students with long hair should tie it up.

      • Verify students' code before handing out batteries.

    4. Testing:

      • Use a micro USB cable for the Bluetooth module or remote.

      • Test the code with the drone in hand to feel movements.

    5. Group Work and Troubleshooting:

      • Form student groups to minimize chaos.

      • Teach students proper troubleshooting techniques.

The entire Codrone Robolink Curriculum van be found at https://learn.robolink.com/ . Take a look at their EXTENSIVE Resources!

History Lesson: On July 20, 1969, American astronaut Neil Armstrong became the first person to walk on the moon, a momentous achievement for the United States in the Space Race.

Quote: "That's one small step for man, one giant leap for mankind." — Neil Armstrong

Motivational Message: Just like the brave astronauts who ventured into the unknown, you have the potential to reach new heights and achieve incredible things with your drone skills. Dream big and soar high!

Let's learn the ABC's of CODING DRONES!!

Introduction to BLOCKLY!!

II. BLOCKLY!!

  • “If you want your dreams to come true, GET OUT OF BED!”

    Read Through Requirements for running Blockly

    https://learn.robolink.com/lesson/codrone-introduction-to-blockly/ 

    I read Through Requirements for running Blockly

    I am running Windows 10 with Version 1803 or greater

    If you are using Mac OS, you should have 2012 hardware or newer.

    Check Bluetooth is enabled and on.

    Google Chrome version is the latest

  • Make sure you save! You can do this by going to the menu in the upper lefthand corner of the workspace and clicking on “Save”. To open a saved program, go to the same menu and click on “Open…”.

    Open the Flight Commands Menu on the left.

    Drag "takeoff" to the workspace in the middle of the page.

    Open the Flight Commands Menu again and Drag "land" to the workspace in the middle of the page. Connect the block to the Takeoff Block.

    If you need to delete blocks, separate what you want to get rid of from your code and drag them to the trashcan in the lower righthand corner.

    Want to see what your code looks like in Python??  Click on one of the coding lan

  • Once you’re ready to run your code, connect to your CoDrone by clicking on the green connect button in the bottom lefthand corner.

    A list of devices should come up. Select the one that says “Petrone (# on the underside of your drone)”. 

    Once you have connected your drone and want to use the same one next time, click on “Pair with Previous” instead.

  • Required to answer. Multiple choice.

    Review the Safety Steps Checklist leaned in previous lesson.

    On the top lefthand side of your workspace Click on “Run code”.  If you followed the above instructions, your drone should take off, hover for a second or two and land.

    If you need to stop your drone for any reason during its flight, click on “Stop”, which is right next to the “Run code” button..

History Lesson: The Wright brothers, Orville and Wilbur, made the first controlled, powered, and sustained flight on December 17, 1903, in Kitty Hawk, North Carolina.

Quote: "The desire to fly is an idea handed down to us by our ancestors who... looked enviously on the birds soaring freely through space." — Wilbur Wright

Motivational Message: The Wright brothers' innovation and determination remind us that no dream is too big. With perseverance and creativity, you can revolutionize the future of aviation and drone technology.

III. FLIGHT COMMANDS

  • “The beginning is the most important part of the work.” —Plato

    1. Click on the blue flight commands menu. Look at all the possible commands.  The take off and land blocks should be at the top!

    Add a take off to your  workspace by dragging it out.

    Add a land to your workspace by dragging it out.  Attach the blocks together!

  • Hover

    If you want your CoDrone to hover for more than three seconds, there is a way to do that! Find the hover for _ seconds block in the flight commands menu and connect it to the bottom of the take off block. Next, type in the number of seconds you would like your CoDrone to hover for.

  • There might be times when your CoDrone is about to crash into something and you need to have it make an emergency stop before it does serious damage. If you want your CoDrone’s motors to stop without crashing into the ceiling first, program a kill switch by dragging a rounded when _ key press block from the gray keyboard inputs menu into the workspace. This should be the block that doesn’t have a connector on the side! Pick the key you would like to use to stop your drone from the block’s drop-down menu, but as a warning, using the backspace key can sometimes delete blocks of code! 

    Next, go to the flight commands menu, find the emergency stop block, and drag it into the when _ key press block. 

    Note: this will be a separate program but will be in the same workspace!

  • Can you make the drone do push ups? In Other Words take off and land repeatedly?

    For clues

  • 5.

    SAVE YOUR CODE

    Click the Menu HAMBURGER next to the Run Code

    Click Save

    Save as any name you want, but I saved mine as "Basic Flight Commands-Junior"


History Lesson: On April 15, 1947, Jackie Robinson broke the color barrier in Major League Baseball by playing for the Brooklyn Dodgers, becoming the first African American to play in the MLB in the modern era.

Quote: "A life is not important except in the impact it has on other lives." — Jackie Robinson

Motivational Message: Jackie Robinson's courage and talent paved the way for future generations. Approach your drone training with the same determination and know that your efforts can inspire and create opportunities for others.

Learn about Drone Light Shows!!

Flight Directions!

IV. Flight Directions!

  • “Beyond the edge of the world there’s a space where emptiness and substance neatly overlap, where past and future form a continuous, endless loop. And, hovering about, there are signs no one has ever read, chords no one has ever heard.”

    ― Haruki Murakami

    The lesson on CoDrone Blockly Jr. flight directions covers programming the CoDrone to move in various directions (up, down, forward, backward, side to side), turn, and fly specific patterns.

    Key steps include using blocks to control flight duration and power, turning for specific times or degrees, and combining commands for complex movements. A challenge encourages students to program the CoDrone to fly in geometric shapes using these commands. For more details, visit Robolink's Flight Directions.

  • The steps for learning turns with CoDrone Blockly Jr. include:

    1. Programming Turn Commands: Use blocks to program the CoDrone to turn left or right.

    2. Setting Turn Duration or Angle: Specify the duration or angle for the turn using appropriate blocks.

    3. Combining Turns with Other Movements: Integrate turn commands with other flight movements like forward or backward.

    4. Practicing with Challenges: Apply the learned turning skills in practice challenges, such as making the drone turn at specific intervals or angles while flying.

    For detailed instructions, visit Robolink's Flight Directions.

  • Practice Exercise 1: Basic Turns

    1. Take Off: Use the "takeoff" block.

    2. Hover: Add a "hover" block for stability.

    3. Turn Right: Insert a "turn right" block set for 2 seconds.

    4. Hover: Add another "hover" block to stabilize after turning.

    5. Land: End with the "land" block.

    Practice Exercise 2: Square Flight Pattern

    1. Take Off: Use the "takeoff" block.

    2. First Side: Move forward for 3 seconds, then turn right 90 degrees.

    3. Second Side: Move forward for 3 seconds, then turn right 90 degrees.

    4. Third Side: Move forward for 3 seconds, then turn right 90 degrees.

    5. Fourth Side and Land: Move forward for 3 seconds, turn right 90 degrees, and land.

    Practice Exercise 3: Zigzag Pattern

    1. Take Off: Use the "takeoff" block.

    2. First Move: Move forward for 2 seconds, then turn left 45 degrees.

    3. Second Move: Move forward for 2 seconds, then turn right 90 degrees.

    4. Repeat Pattern: Repeat the forward and turn sequence for a total of three zigzags.

    5. Land: Stabilize with a hover and then use the "land" block.

    For more detailed instructions, visit Robolink's Flight Directions.

    • Challenge: Shapeshifter 

      Have your CoDrone fly in a shape using all of the commands you just learned! The only rule is that you HAVE to include a kill switch. 

      Some helpful hints: 

      • A triangle’s angles add up to 180 degrees. 

      • A quadrilateral’s angles add up to 360 degrees. 

      • A pentagon’s angles add up to 540 degrees. 

      • A hexagon’s angles add up to 720 degrees. 

      • An octagon’s angles add up to 1080 degrees. 

History Lesson: On May 6, 1954, Roger Bannister became the first person to run a mile in under four minutes, achieving a time of 3:59.4.

Quote: "The man who can drive himself further once the effort gets painful is the man who will win." — Roger Bannister

Motivational Message: Roger Bannister's achievement reminds us that breaking barriers requires pushing past limits. Apply this mindset to your drone projects, pushing yourself to achieve what seems impossible.

V. Flight Conditionals and Variables

What are Conditionals!?

  • "My mission is to create a world where we can live in harmony with nature." - Jane Goodall

    • What are Conditionals?

      Conditionals are statements that help programs make decisions based on whether a condition is true or false. In Blockly, conditionals include if, else if, and else statements. You use conditionals to make decisions in everyday life. Here are examples:

      If Statements:

      • If it is raining, then I will take an umbrella.

      • If I am hungry, I will eat lunch.

      If-Else Statements:

      • If it is raining, then I will take an umbrella. Else, I will wear sunglasses.

      • If I am hungry, I will eat lunch. Else, I will wait until dinner.

      If-Else If-Else Statements:

      • If it is raining, then I will take an umbrella. Else if it is cloudy, I will take a jacket. Else, I will wear sunglasses.

      • If I am hungry, I will eat lunch. Else if I am thirsty, I will drink water. Else, I will continue working.

      Conditionals in Blockly

      In Blockly, conditionals are used similarly:

      • If Statement: If the CoDrone's battery is low, then the CoDrone will land.

      • If-Else Statement: If the CoDrone's battery is low, the CoDrone will land. Else, the CoDrone will continue flying.

      • If-Else If-Else Statement: If the CoDrone's battery is low, the CoDrone will land. Else if an obstacle is detected, the CoDrone will hover. Else, the CoDrone will continue flying.

  • Practice Exercise 1: Simple Addition Check

    Objective: Program the CoDrone to react based on a math condition.

    1. Condition: If 3 + 2 equals 5.

    2. Action: Then, the CoDrone will take off.

    3. Else: The CoDrone will stay on the ground.

    4. Test: Run the program to check if the CoDrone takes off.

    5. Modify: Change the addition equation and observe the behavior.

    Practice Exercise 2: Greater Than Comparison

    Objective: Program the CoDrone to react based on a comparison.

    1. Condition: If 7 is greater than 4.

    2. Action: Then, the CoDrone will flash its LED lights.

    3. Else: The LED lights will remain off.

    4. Test: Run the program to see if the LEDs flash.

    5. Modify: Change the numbers in the comparison and test again.

    Practice Exercise 3: Equal Value Check

    Objective: Program the CoDrone to react if two values are equal.

    1. Condition: If 10 - 3 equals 7.

    2. Action: Then, the CoDrone will spin in a circle.

    3. Else: The CoDrone will hover in place.

    4. Test: Run the program to see if the CoDrone spins.

    5. Modify: Change the subtraction equation and test the reaction.

  • What are Variables?

    Variables are used to store information that can be referenced and manipulated (used) in a program. In Blockly, variables are like containers that hold values, which can change as the program runs. You use variables in daily life to keep track of changing information. Here's how you might use a variable, typically seen as “set ____ to ____”:

    • Set my age to 10.

    • Set the temperature to 75°F.

    Variables can also be updated as conditions change:

    • Set my age to my age + 1 on my birthday.

    • Set the temperature to the current temperature reading every hour.

    In Blockly, variables allow dynamic control and data management. For example:

    • Set Variable: Set altitude to 10 meters.

    • Update Variable: Set altitude to altitude + 1 meter every second.

  • Practice Exercise 1: Setting X and Y Variables for Movement

    Objective: Program the CoDrone to move right and forward using variables.

    1. Create Variables: Create variables named "x" and "y."

    2. Set Initial Values: Set "x" to 3 and "y" to 2.

    3. Move Right: Use the "x" variable and Flight Directions to move right by 3 units.

    4. Move Forward: Use the "y" variable and Flight Directions to move forward by 2 units.

    5. Test: Run the program to see the CoDrone move right and then forward.

    Practice Exercise 2: Using Variables in Movement

    Objective: Program the CoDrone to move based on variable values.

    1. Create Variables: Create variables named "x" and "y."

    2. Set Initial Values: Set "x" to 10 and "y" to 10.

    3. Move Command: Use the "x" and "y" variables to control the CoDrone's movement distance.

    4. Change Values: Adjust "x" to 15 and "y" to 5.

    5. Test: Run the program to see the CoDrone move accordingly.

    Practice Exercise 3: Conditional Movement with Variables

    Objective: Program the CoDrone to decide movement based on variable values.

    1. Create Variables: Create variables named "x" and "y."

    2. Set Initial Values: Set "x" to 7 and "y" to 7.

    3. Condition Check: If "x" is equal to "y," move forward.

    4. Change Values: Set "x" to 10 and "y" to 7.

    5. Test: Run the program to observe the CoDrone's behavior based on the condition.

    For more detailed instructions, visit Robolink CoDrone Blockly Jr. Variables.

  • Classroom Challenge: Desk Navigation

    Objective: Program the CoDrone to navigate around desks and chairs in a classroom, using conditionals and variables.

    Parameters:

    1. Start Point: Define a starting point at the front of the classroom.

    2. Obstacles: Arrange desks and chairs to create a path with obstacles.

    3. Variables: Create variables named "x" and "y" to track the CoDrone’s movement along the path.

    4. Conditionals: Use conditionals to check for obstacles and adjust the drone’s path:

      • If an obstacle is detected within 10 cm, move up.

      • If no obstacle is detected, continue moving forward.

    5. Goal: Successfully navigate the CoDrone from the starting point to a designated end point (e.g., a specific desk or the back of the classroom).

Embed Block
Add an embed URL or code. Learn more

Science Lesson: Charles Darwin’s theory of evolution, published in "On the Origin of Species" in 1859, fundamentally changed our understanding of life on Earth.

Quote: "It is not the strongest of the species that survive, nor the most intelligent, but the one most responsive to change." — Charles Darwin

Motivational Message: Darwin’s work teaches us the importance of adaptability and understanding our environment. As you develop your drone skills, be open to learning and adapting, always respecting the natural world around you.

VI. Loops & LEDs

Embed Block
Add an embed URL or code. Learn more

Science Lesson: On March 2, 1972, NASA launched the Pioneer 10 spacecraft, which became the first human-made object to travel through the asteroid belt and provide close-up images of Jupiter.

Quote: "Exploration is really the essence of the human spirit." — Frank Borman

Motivational Message: Pioneer 10’s journey represents humanity’s drive to explore the unknown. Use your drones to explore and learn about the natural world, fostering a spirit of curiosity and respect for the environment.

  • "Make your life a mission - not an intermission." - Arnold H. Glasgow
    Introduction to Loops

    Loops allow you to repeat sections of code efficiently. Blockly has three types of loops:

    • For Loops: Repeat code a specific number of times.

    • While Loops: Repeat code as long as a condition is true.

    • Until Loops: Repeat code until a condition is true.

    Using For Loops

    For loops repeat code a set number of times. Blockly offers two for loop blocks:

    • Repeat _ times: Specify a number directly or use a variable.

    • Count with: More advanced, using a variable to count within a range.

    1. Access Blockly: Open the CoDrone Blockly interface.

    2. Find the For Loop Block:

      • Locate the "Loops" category in the Blockly toolbox.

      • Drag the "repeat _ times" block or the "count with" block to the workspace.

    3. Set the Loop Count:

      • For "repeat _ times": Enter the number of iterations directly.

      • For "count with": Define the variable, start value, end value, and step size.

    4. Add Actions:

      • Place the actions you want to repeat inside the loop block.

      • Examples include moving the drone, changing LED colors, or playing sounds.

    5. Run the Program: Upload the code to your drone and observe the repeated actions.

    For more detailed examples and instructions, visit Robolink's CoDrone Blockly Jr Loops Lesson.

  • While Loops

    While loops repeat code while a condition is true. Use them to perform actions repeatedly based on dynamic conditions.

    Until Loops

    Until loops function like while loops but run until a condition is true, useful for tasks needing repetition until a specific event occurs.

    Explore more at Robolink's CoDrone Blockly Jr Loops Lesson.

    While Loops

    1. Access Blockly: Open the CoDrone Blockly interface.

    2. Find the While Loop Block:

      • Go to the "Loops" category in the Blockly toolbox.

      • Drag the "while" block to the workspace.

    3. Set the Condition:

      • Define the condition that needs to be true for the loop to execute.

      • Example: while (battery level > 20%).

    4. Add Actions:

      • Place the actions you want to repeat inside the while block.

      • Examples: move forward, turn left, etc.

    5. Run the Program: Upload the code to your drone and observe the repeated actions until the condition is false.

    Until Loops

    1. Find the Until Loop Block:

      • In the "Loops" category, find the "repeat until" block.

      • Drag it to the workspace.

    2. Set the Condition:

      • Define the condition that needs to be true for the loop to stop.

      • Example: until (distance < 10cm).

    3. Add Actions:

      • Place the actions you want to repeat inside the until block.

      • Examples: hover, change LED color, etc.

    4. Run the Program: Upload the code to your drone and observe the repeated actions until the condition becomes true.

    For detailed examples and further guidance, visit Robolink's CoDrone Blockly Jr Loops Lesson.

  • Practical Examples

    • Program a Stair-Climbing Drone: Use for loops to make the drone ascend steps.

    • Shape-Flying Drone: Use while loops to fly in geometric patterns.

    • Disco Drone Challenge: Use loops to create dynamic LED light patterns on the drone, like a disco ball. Add music to make it more interesting.

    • What is an LED?

      An LED (Light-Emitting Diode) is a small electronic component that emits light when electricity passes through it. Unlike traditional incandescent bulbs, which use a filament that heats up to produce light, LEDs use a semiconductor to emit light. This makes LEDs much more energy-efficient and longer-lasting.

      LEDs on Your CoDrone

      Your CoDrone is equipped with 6 RGB LEDs: one on each arm, one for the eyes, and one for the tail. RGB stands for red, green, and blue, and by combining these colors, you can create almost any color imaginable.

      Traditional Bulbs vs. LEDs

      Traditional Bulbs:

      • Mechanism: Use a filament that heats up to produce light.

      • Energy Use: Consume more power, as a lot of energy is lost as heat.

      • Lifespan: Shorter lifespan, often needing replacement.

      LEDs:

      • Mechanism: Use a semiconductor to emit light when an electric current passes through.

      • Energy Use: More efficient, using less power to produce the same amount of light.

      • Lifespan: Much longer lifespan, reducing the need for frequent replacements.

      LEDs on Your CoDrone

      The CoDrone has 6 RGB LEDs: one on each of the four arms, one for the eyes, and one for the tail. These LEDs can be programmed to display a wide range of colors, not only making the drone look cool but also providing important feedback. For example, the tail light shows the drone's connection status: a solid green means it's connected, while a flashing green means it's in pairing mode. While the tail light's color is fixed, you can program the other LEDs to display any color and pattern you want.

  • Parameters for CoDrone LED Controls

    CoDrone allows you to control the arm LEDs, eye LEDs, or both through the Lights menu. Each LED block has several parameters:

    • Color: Click on the color to open a menu and choose the desired LED color.

    • Brightness: For solid LED blocks, set the brightness from 0 (off) to 100 (full brightness).

    • Mode: Choose the light pattern:

      • BLINK: LEDs flash on and off.

      • DOUBLE BLINK: LEDs flash twice before turning off.

      • DIMMING: LEDs fade in and out.

    • Interval: Set the frequency (per second) for light patterns, ensuring the interval value is positive

    Practical Elementary Exercises with CoDrone LED Parameters

    Exercise 1: Color Fun

    • Objective: Change the color of the drone's LEDs.

    • Instructions:

      1. Open the Lights menu.

      2. Drag the "set arm LEDs to" block to the workspace.

      3. Click on the color parameter and choose a color (e.g., red, blue, green).

      4. Upload the code and observe the LEDs change color.

    Exercise 2: Brightness Control

    • Objective: Adjust the brightness of the LEDs.

    • Instructions:

      1. Select the "set arm LEDs to" block from the Lights menu.

      2. Set the brightness parameter to different values (0, 25, 50, 75, 100).

      3. Upload the code each time and observe the brightness change.

    Exercise 3: Light Patterns

    • Objective: Explore different light modes.

    • Instructions:

      1. Select the "set arm LEDs to" block.

      2. Choose a mode: BLINK, DOUBLE BLINK, or DIMMING.

      3. Set the interval (e.g., 1 second).

      4. Upload the code and watch the LEDs display different patterns.

    Exercise 4: Rainbow Cycle

    • Objective: Create a rainbow cycle with the LEDs.

    • Instructions:

      1. Use multiple "set arm LEDs to" blocks.

      2. Set each block to a different color (red, orange, yellow, green, blue, purple).

      3. Arrange the blocks to change colors every 2 seconds.

      4. Upload the code and watch the LEDs cycle through colors.

    Exercise 5: Connection Status Indicator

    • Objective: Program the tail light to indicate connection status.

    • Instructions:

      1. Select the "set tail LED to" block.

      2. Program it to show solid green when connected and flashing green when in pairing mode.

      3. Test the drone by connecting and disconnecting it, observing the tail light for status changes.

    These exercises provide clear, step-by-step instructions to help students understand and experiment with CoDrone LED parameters in a hands-on and engaging way.

  • Understanding Morse Code

    Morse Code: A communication system using a series of dots (short signals) and dashes (long signals) to represent letters, numbers, and punctuation. It was historically used in telegraphy and radio communications.

    • Dot: Short signal (e.g., short blink)

    • Dash: Long signal (e.g., long blink)

    Exercise: Using Morse Code with Drone LEDs

    Objective

    • Program your drone's LEDs to blink in Morse code to spell "SOS" (the universal distress signal).

    Instructions

    1. Open Blockly Interface:

      • Access the CoDrone Blockly interface.

    2. Create Morse Code for SOS:

      • S: ... (dot-dot-dot)

      • O: --- (dash-dash-dash)

      • S: ... (dot-dot-dot)

    3. Program Dots and Dashes:

      • Use the "set arm LEDs to" block.

      • For dots: Set a short blink (e.g., 0.2 seconds on, 0.2 seconds off).

      • For dashes: Set a long blink (e.g., 0.6 seconds on, 0.2 seconds off).

    4. Arrange Blocks:

      • Sequence the blocks to create ... --- ... with appropriate delays between letters (e.g., 0.6 seconds).

    5. Example Code:

      python

      Copy code

      set LED to on for 0.2 seconds # Dot set LED to off for 0.2 seconds set LED to on for 0.2 seconds # Dot set LED to off for 0.2 seconds set LED to on for 0.2 seconds # Dot set LED to off for 0.6 seconds # Space between letters set LED to on for 0.6 seconds # Dash set LED to off for 0.2 seconds set LED to on for 0.6 seconds # Dash set LED to off for 0.2 seconds set LED to on for 0.6 seconds # Dash set LED to off for 0.6 seconds # Space between letters set LED to on for 0.2 seconds # Dot set LED to off for 0.2 seconds set LED to on for 0.2 seconds # Dot set LED to off for 0.2 seconds set LED to on for 0.2 seconds # Dot set LED to off for 0.6 seconds # End

    6. Upload and Test:

      • Upload the code to your drone.

      • Observe the LEDs blink in Morse code, spelling "SOS".

    This exercise teaches students how to use loops, timings, and LED control to create meaningful signals with their drones.

    4o

    The Morse Code alphabet and learn some letters.