> ## Documentation Index
> Fetch the complete documentation index at: https://stem-docs.intellectualpoint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Your first program

> Build and run your first block program - take off, hover, and land, all from code.

## Hello, flight!

Time for the big moment: your first program that flies the drone with no hands on the controller. You'll build a simple take off, hover, and land sequence - the "hello world" of drone coding.

<Warning>
  Fly in a clear space with no people or pets nearby. Keep the red **LAND NOW** button in reach - clicking it lands the drone immediately.
</Warning>

## The Flight blocks

Click the **Flight** category to see the flight blocks. These are your core commands:

<Frame caption="The Flight blocks: take off, hover, fly, spin, and land">
  <img src="https://mintcdn.com/intellectualpoint/eW7U9shBQKKM3XX9/images/drones/echo-flight-blocks.png?fit=max&auto=format&n=eW7U9shBQKKM3XX9&q=85&s=553701ed5e0549d569a036cf6cf75fb3" alt="echo.pitsco.com Flight block category showing take off, hover for, fly, spin, and land blocks" width="1024" height="623" data-path="images/drones/echo-flight-blocks.png" />
</Frame>

| Block                                                  | What it does                  |
| ------------------------------------------------------ | ----------------------------- |
| **take off**                                           | Drone rises and hovers        |
| **hover for \[1] second(s)**                           | Holds position for a set time |
| **fly \[forward] for \[1] second(s) at \[50] % speed** | Flies a direction for a time  |
| **spin \[left] for \[1] second(s) at \[50] % speed**   | Rotates in place              |
| **land**                                               | Lands the drone               |

## Build the program

<Steps>
  <Step title="Drag out take off" icon="plane-takeoff">
    From the **Flight** category, drag a **take off** block into the workspace. Programs start right with take off - there's no separate start block.
  </Step>

  <Step title="Add a hover" icon="clock">
    Snap a **hover for 3 second(s)** block underneath, so the drone holds steady for a moment.
  </Step>

  <Step title="Add land" icon="plane-landing">
    Snap a **land** block at the end. Always finish a program by landing.
  </Step>
</Steps>

Your first program looks like this:

```text theme={null}
take off
hover for 3 second(s)
land
```

<Frame caption="Three blocks snapped together - your very first flight program">
  <img src="https://mintcdn.com/intellectualpoint/eW7U9shBQKKM3XX9/images/drones/first-program-stack.png?fit=max&auto=format&n=eW7U9shBQKKM3XX9&q=85&s=14f5b2f5e88b02c0633458d3ecf5873e" alt="A stack of three blocks: take off, hover for 3 seconds, land" width="1536" height="1024" data-path="images/drones/first-program-stack.png" />
</Frame>

## Run it

<Steps>
  <Step title="Click START PROGRAM" icon="play">
    Click the green **START PROGRAM** button in the toolbar.
  </Step>

  <Step title="Confirm" icon="check">
    A message says **"Ready to execute the Block code for ECHO."** Click **OK** and your drone runs the program - take off, hover, land!

    <Frame caption="Click OK to run your program on the drone">
      <img src="https://mintcdn.com/intellectualpoint/eW7U9shBQKKM3XX9/images/drones/echo-ready-alert.png?fit=max&auto=format&n=eW7U9shBQKKM3XX9&q=85&s=ab55aaaee2df8fbae10040df15ccecee" alt="echo.pitsco.com ready to execute confirmation dialog" width="1024" height="623" data-path="images/drones/echo-ready-alert.png" />
    </Frame>
  </Step>

  <Step title="Land anytime" icon="hand">
    If you ever need to stop, click the red **LAND NOW** button.
  </Step>
</Steps>

## Save your work

Your **save code** is at the top of the screen (like `FZD6O4`). Write it down - you can reopen this program later with **I have a code**. You can also use the **FILE** menu to manage your work.

## Experiment

<CardGroup cols={2}>
  <Card title="Change the hover time" icon="clock">
    Make it hover for 5 seconds instead of 3. How does the flight change?
  </Card>

  <Card title="Add a wait" icon="timer">
    From the **Control** category, add a **wait for \[1] seconds** block between moves.
  </Card>
</CardGroup>

<Tip>
  Always end every program with a **land** block. If a program finishes without landing, the drone keeps hovering until you click LAND NOW. Landing cleanly is a habit of every good drone programmer.
</Tip>

## Level-up challenges

Finished early? Keep building. Each of these only adds one or two blocks:

<CardGroup cols={2}>
  <Card title="The elevator" icon="arrow-up">
    take off → hover → **fly up** briefly → hover → **fly down** → land.
  </Card>

  <Card title="The spinner" icon="rotate-3d">
    take off → **spin right** 2 seconds → **spin left** 2 seconds → land. Does it end facing where it started?
  </Card>

  <Card title="The scout" icon="move">
    take off → fly forward → hover → fly backward the same time → land. Did it come home?
  </Card>

  <Card title="The showoff" icon="sparkles">
    Chain four different moves into a mini routine. Give it a name and demo it to a friend.
  </Card>
</CardGroup>

<Warning>
  **Instructor - fly one at a time.** With a room of coded drones, run programs one team at a time in a marked flight zone. Everyone else keeps hands off the START button and a finger near LAND NOW.
</Warning>

<Check>
  You built and ran a program that takes off, hovers, and lands using START PROGRAM, tried at least one level-up challenge, and saved your work with the code.
</Check>
