> ## 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.

# Tour of the blocks

> A full reference for every AT-66BL block category - Fly, Events, Control, Sensing, Operators, Variables, and My Blocks - with real screenshots and what each block does.

## Your complete toolbox

Before you build, get to know your tools. The AT-66BL app groups blocks into color-coded categories on the left edge. This page is your **reference** - come back to it any time you forget what a block does.

<Info>
  **Color = category.** Blue is flight, yellow is events, orange is control and variables, light-blue is sensing, green is math. The colors match Scratch, so if you've used Scratch before, you already know your way around.
</Info>

<Frame caption="The block color legend - learn the colors and you can find any block fast">
  <img src="https://mintcdn.com/intellectualpoint/eW7U9shBQKKM3XX9/images/drones/block-color-legend.png?fit=max&auto=format&n=eW7U9shBQKKM3XX9&q=85&s=1423ee6f28815be72d8677fca3d1bbc2" alt="Color legend mapping AT-66BL block categories to their colors" width="1536" height="1024" data-path="images/drones/block-color-legend.png" />
</Frame>

## Fly (blue) - make the drone move

The **Fly** category holds every movement command. These are unique to the drone.

<Frame caption="The Fly blocks - take off, land, and every movement command">
  <img src="https://mintcdn.com/intellectualpoint/i7Ng90YWtTAWa_94/images/drones/at66bl-fly-blocks.png?fit=max&auto=format&n=i7Ng90YWtTAWa_94&q=85&s=4be6303a7d5e36c15ae3e5e2dd8c7317" alt="AT-66BL Fly category blocks" width="1024" height="811" data-path="images/drones/at66bl-fly-blocks.png" />
</Frame>

| Block                                                | What it does                                    |
| ---------------------------------------------------- | ----------------------------------------------- |
| **active fly** 🔒                                    | Arms the motors so the drone is ready to fly    |
| **take off**                                         | Rises and hovers at a steady height             |
| **land**                                             | Descends and powers down the motors             |
| **throttle \[3]**                                    | Sets how much power/height to hold              |
| **rotate \[left ▾] speed \[1]**                      | Spins in place left or right                    |
| **fly \[front ▾] speed \[1]**                        | Flies continuously in a direction               |
| **vertical move \[up ▾] \[10] cm speed \[1]**        | Moves up or down an exact distance              |
| **horizontal move \[Forward ▾] \[10] cm speed \[1]** | Moves forward/back/left/right an exact distance |
| **turn \[Left ▾] \[90] degree speed \[1]**           | Turns an exact number of degrees                |

<Tip>
  The **vertical move**, **horizontal move**, and **turn** blocks use **exact distances and degrees** - perfect for precise shapes. That's a big upgrade over time-based flying.
</Tip>

## Events (yellow) - start and signal

**Events** are how programs *begin* and how parts of a program talk to each other.

<Frame caption="The Events blocks - start your program and broadcast messages">
  <img src="https://mintcdn.com/intellectualpoint/i7Ng90YWtTAWa_94/images/drones/at66bl-events-blocks.png?fit=max&auto=format&n=i7Ng90YWtTAWa_94&q=85&s=030cdef9e22988bab003c05bc046b8b6" alt="AT-66BL Events category blocks" width="1024" height="811" data-path="images/drones/at66bl-events-blocks.png" />
</Frame>

| Block                                | What it does                                      |
| ------------------------------------ | ------------------------------------------------- |
| **when 🏳 clicked**                  | Starts your program when you click the green flag |
| **when I receive \[message1 ▾]**     | Runs when a matching broadcast is sent            |
| **broadcast \[message1 ▾]**          | Sends a message to trigger other scripts          |
| **broadcast \[message1 ▾] and wait** | Sends a message and waits until it finishes       |

<Note>
  Every program starts with a **when 🏳 clicked** hat block. Snap your flight blocks right underneath it.
</Note>

## Control (orange) - loops and decisions

**Control** blocks are the logic of your program - how it repeats, waits, and decides.

<Frame caption="The Control blocks - loops, waits, and if-then decisions">
  <img src="https://mintcdn.com/intellectualpoint/i7Ng90YWtTAWa_94/images/drones/at66bl-control-blocks.png?fit=max&auto=format&n=i7Ng90YWtTAWa_94&q=85&s=90055b95abf226a69e400952fb3d044a" alt="AT-66BL Control category blocks" width="1024" height="811" data-path="images/drones/at66bl-control-blocks.png" />
</Frame>

| Block                          | What it does                                    |
| ------------------------------ | ----------------------------------------------- |
| **wait \[1] seconds**          | Pauses before the next block                    |
| **wait \[1] seconds and stop** | Waits, then stops the program                   |
| **repeat \[10]**               | Repeats the blocks inside a set number of times |
| **forever**                    | Repeats the blocks inside without stopping      |
| **if `<>` then**               | Runs blocks only if a condition is true         |
| **if `<>` then / else**        | Runs one set if true, another if false          |
| **wait until `<>`**            | Pauses until a condition becomes true           |
| **repeat until `<>`**          | Repeats until a condition becomes true          |
| **stop \[all ▾]**              | Stops scripts                                   |

<Tip>
  A **repeat** loop is your best friend for shapes: "repeat 4 times: move forward, turn 90°" flies a perfect square with just a few blocks.
</Tip>

## Sensing (light blue) - the timer

**Sensing** lets your program react to time.

<Frame caption="The Sensing blocks - timer and reset timer">
  <img src="https://mintcdn.com/intellectualpoint/eW7U9shBQKKM3XX9/images/drones/at66bl-sensing-blocks.png?fit=max&auto=format&n=eW7U9shBQKKM3XX9&q=85&s=42cc410f773bd4c7166f14a426d5d530" alt="AT-66BL Sensing category blocks" width="1024" height="811" data-path="images/drones/at66bl-sensing-blocks.png" />
</Frame>

| Block           | What it does                                              |
| --------------- | --------------------------------------------------------- |
| **timer**       | Reports seconds since the program (or last reset) started |
| **reset timer** | Sets the timer back to zero                               |

Pair **timer** with **wait until** or **if-then** to build time-based routines - like "do a trick every 5 seconds."

## Operators (green) - math and logic

**Operators** do math and compare values. You drop them *inside* other blocks.

<Frame caption="The Operators blocks - arithmetic, random, comparisons, and logic">
  <img src="https://mintcdn.com/intellectualpoint/eW7U9shBQKKM3XX9/images/drones/at66bl-operators-blocks.png?fit=max&auto=format&n=eW7U9shBQKKM3XX9&q=85&s=f25b765e9a2705a700d8e0be9643852f" alt="AT-66BL Operators category blocks" width="1024" height="811" data-path="images/drones/at66bl-operators-blocks.png" />
</Frame>

| Block                                    | What it does                            |
| ---------------------------------------- | --------------------------------------- |
| **\[ ] + \[ ]** (also `-`, `×`, `÷`)     | Basic arithmetic                        |
| **pick random \[1] to \[10]**            | Returns a random number in a range      |
| **\[ ] > \[ ]**, **\< \[ ]**, **= \[ ]** | Compares two values (true/false)        |
| **`<>` and `<>`**, **or**, **not**       | Combines or flips true/false conditions |
| **\[ ] mod \[ ]**                        | Remainder after division                |
| **round \[ ]**                           | Rounds to the nearest whole number      |
| **\[abs ▾] of \[ ]**                     | Math functions like absolute value      |

<Tip>
  `pick random` makes programs feel alive: **turn (pick random 1 to 4) × 90 degrees** sends the drone a surprising direction every run.
</Tip>

## Variables (orange) - store values

A **variable** is a named box that holds a number you can read and change.

<Frame caption="The Variables blocks - make, set, change, show, and hide values">
  <img src="https://mintcdn.com/intellectualpoint/eW7U9shBQKKM3XX9/images/drones/at66bl-variables-blocks.png?fit=max&auto=format&n=eW7U9shBQKKM3XX9&q=85&s=c13cad7b2c0e3bcbab7b79c3ed9df8ef" alt="AT-66BL Variables category blocks" width="1024" height="811" data-path="images/drones/at66bl-variables-blocks.png" />
</Frame>

| Block                               | What it does                                  |
| ----------------------------------- | --------------------------------------------- |
| **Make a Variable**                 | Creates a new named variable                  |
| **my variable**                     | Reports the value (drop it into other blocks) |
| **set \[my variable ▾] to \[0]**    | Sets a variable to a value                    |
| **change \[my variable ▾] by \[1]** | Adds to a variable                            |
| **show / hide variable**            | Shows or hides it on screen                   |
| **Make a List**                     | Creates a list to hold many values            |

When you click **Make a Variable**, this dialog appears - name it and choose the scope:

<Frame caption="Naming a new variable">
  <img src="https://mintcdn.com/intellectualpoint/eW7U9shBQKKM3XX9/images/drones/at66bl-new-variable.png?fit=max&auto=format&n=eW7U9shBQKKM3XX9&q=85&s=f5c329f716c69a3d397e0c7d97a474ba" alt="AT-66BL New Variable dialog" width="1024" height="811" data-path="images/drones/at66bl-new-variable.png" />
</Frame>

Lists work the same way with **Make a List**:

<Frame caption="Naming a new list">
  <img src="https://mintcdn.com/intellectualpoint/eW7U9shBQKKM3XX9/images/drones/at66bl-new-list.png?fit=max&auto=format&n=eW7U9shBQKKM3XX9&q=85&s=91ec0c52ebebba699f6221273e2768b8" alt="AT-66BL New List dialog" width="1024" height="811" data-path="images/drones/at66bl-new-list.png" />
</Frame>

## My Blocks - build your own

**My Blocks** lets you package a sequence of blocks into one **custom block** you name yourself. Click **Make a Block**, give it a name (like `do_a_flip`), and reuse it anywhere.

<Frame caption="Making your own custom block">
  <img src="https://mintcdn.com/intellectualpoint/eW7U9shBQKKM3XX9/images/drones/at66bl-make-block.png?fit=max&auto=format&n=eW7U9shBQKKM3XX9&q=85&s=6789bc27d02e620b21dce90bb1c6e5e7" alt="AT-66BL Make a Block dialog" width="1024" height="811" data-path="images/drones/at66bl-make-block.png" />
</Frame>

<Tip>
  Custom blocks are how pros keep programs tidy. Build a `square` block once, then a "dance" that calls `square` three times reads like plain English.
</Tip>

<Check>
  You can name all seven categories, and you know where to find **take off**, **repeat**, **when 🏳 clicked**, **Make a Variable**, and **Make a Block**.
</Check>

<Card title="Next: your first AT-66BL program" icon="arrow-right" href="/drone-programming/day-5/first-at66bl-program">
  Build the "hello world" of AT-66BL - take off, hover, land - with the green flag.
</Card>
