> ## 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 AT-66BL program

> Build and run the hello-world of AT-66BL - take off, hover, and land - starting from the green flag.

## Hello, flight - again

You wrote your first program on echo.pitsco.com. Now let's do the same thing in AT-66BL so you learn the one big difference: **programs start with the green flag** (a **when 🏳 clicked** block), not with take off.

<Frame caption="Nothing runs until the green flag is clicked - it's the 'start here' of every program">
  <img src="https://mintcdn.com/intellectualpoint/eW7U9shBQKKM3XX9/images/drones/green-flag-start.png?fit=max&auto=format&n=eW7U9shBQKKM3XX9&q=85&s=4f4d82bca67de76216fa37f54ac2c790" alt="Illustration of the green flag starting an AT-66BL program" width="1536" height="1024" data-path="images/drones/green-flag-start.png" />
</Frame>

<Warning>
  Fly in a clear space with no people or pets nearby. Before you click the green flag, know where the **red stop** and **no-entry** buttons are. Clicking them ends the flight immediately.
</Warning>

## The workspace, one more time

Open **Program** mode. Blocks are on the left, your canvas is the middle, and the run controls (green flag, stop, no-entry, save) are top-right.

<Frame caption="A finished first program: when flag clicked, take off, wait, land">
  <img src="https://mintcdn.com/intellectualpoint/eW7U9shBQKKM3XX9/images/drones/at66bl-workspace.png?fit=max&auto=format&n=eW7U9shBQKKM3XX9&q=85&s=e64ace6820cf17d48560cd89157667f8" alt="AT-66BL workspace with a when flag clicked, take off, wait 1 seconds, land program" width="1024" height="811" data-path="images/drones/at66bl-workspace.png" />
</Frame>

## Build it block by block

<Steps>
  <Step title="Start with the green flag" icon="flag">
    Open **Events** (yellow) and drag out a **when 🏳 clicked** block. This is the "start here" for every AT-66BL program.
  </Step>

  <Step title="Add take off" icon="plane-takeoff">
    Open **Fly** (blue) and snap a **take off** block under the flag. The drone will rise and hover.
  </Step>

  <Step title="Hover with a wait" icon="clock">
    Open **Control** (orange) and snap a **wait \[1] seconds** block. Change it to **3** so the drone holds steady for a moment.
  </Step>

  <Step title="Finish with land" icon="plane-landing">
    Back in **Fly**, snap a **land** block at the very bottom. Always end a program by landing.
  </Step>
</Steps>

Your finished stack reads:

```text theme={null}
when 🏳 clicked
take off
wait 3 seconds
land
```

## Run it

<Steps>
  <Step title="Check your connection" icon="bluetooth">
    Make sure the Bluetooth icon shows you're still paired to your drone.
  </Step>

  <Step title="Click the green flag" icon="play">
    Click the 🏳 **green flag** in the top-right. The drone takes off, hovers for 3 seconds, and lands.
  </Step>

  <Step title="Stop anytime" icon="hand">
    If anything looks wrong, click the 🔴 **red stop** to end the program, or the 🚫 **no-entry** button to cut the motors instantly.
  </Step>
</Steps>

## Save your work

Click the 💾 **save icon** and choose **Save**. Give it a clear name like `first_flight`. You can reopen it later with **Load**.

## Now make it yours

<CardGroup cols={2}>
  <Card title="Longer hover" icon="clock">
    Change **wait 3 seconds** to 5. Does the drone hold longer?
  </Card>

  <Card title="Add a move" icon="arrow-up">
    Between take off and land, add **vertical move up 20 cm** and watch it climb.
  </Card>

  <Card title="Add a spin" icon="rotate-cw">
    Try **turn right 90 degrees** before landing.
  </Card>

  <Card title="Add a pause" icon="timer">
    Stack two **wait** blocks with a move between them for a step-pause-step feel.
  </Card>
</CardGroup>

<Tip>
  **Instructor:** the #1 beginner mistake here is forgetting the **when 🏳 clicked** hat, then wondering why the green flag does nothing. If a student's program won't run, check for the yellow hat block first.
</Tip>

<Warning>
  Every program should end with **land**. If it finishes without landing, the drone keeps hovering until you hit stop or no-entry.
</Warning>

<Check>
  You built a **when 🏳 clicked → take off → wait → land** program, ran it with the green flag, and saved it with a name you can find again.
</Check>

<Card title="Next: advanced programs" icon="arrow-right" href="/drone-programming/day-5/advanced-programs">
  Add loops, variables, decisions, and custom blocks to build real missions.
</Card>
