Skip to content

Quick Start

Get up and running with Blockly Python Executor in just a few minutes!

Your First Program

Let's create a simple "Hello, World!" program to get familiar with the interface.

Step 1: Open the Application

  1. Launch Blockly Python Executor
  2. You'll see the main interface with:
  3. Toolbox (left side) - Contains all available blocks
  4. Workspace (center) - Where you build your program
  5. Code pane (right side) - Shows generated Python code
  6. Terminal (bottom) - Shows program output

Step 2: Create a Simple Program

  1. Find the Text category in the toolbox (left side)
  2. Drag a "print" block to the workspace
  3. Drag a "text" block and connect it to the print block
  4. Type "Hello, World!" in the text block

Your workspace should look like this:

┌─────────────┐
│ print "Hello, World!" │
└─────────────┘

Step 3: Run Your Program

  1. Click "Run Code" button
  2. Watch the terminal - You should see "Hello, World!" printed
  3. Check the code pane - You'll see the generated Python code

Understanding the Interface

Main Components

Toolbox

Contains all available blocks organized by category: - Logic - If/else, comparisons, boolean operations - Loops - For loops, while loops, repeat - Math - Numbers, arithmetic, functions - Text - String operations and manipulation - Lists - Array operations - Variables - Create and use variables - Functions - Define custom functions - Timing - Sleep and wait operations - Drone Commands - Flight control blocks

Workspace

The main area where you build your program: - Drag blocks from the toolbox - Connect blocks by dragging them together - Delete blocks by dragging them to the trash - Zoom and pan using mouse wheel and right-click drag

Code Pane

Shows the Python code generated from your blocks: - Real-time updates as you modify blocks - Syntax highlighting for better readability - Line numbers for easy reference - Copy functionality to use code elsewhere

Terminal

Shows the output when you run your program: - Execution results from your Python code - Error messages if something goes wrong - Interactive input for programs that need user input - Resizable - drag the top border to adjust height

Basic Block Operations

Connecting Blocks

  1. Drag a block from the toolbox
  2. Position it near another block
  3. Snap them together - they'll connect automatically
  4. Disconnect by dragging them apart

Block Types

  • Statement blocks - Do something (print, assign, etc.)
  • Value blocks - Return a value (numbers, text, etc.)
  • Conditional blocks - Control program flow (if, loops)
  • Hat blocks - Start of programs (when clicked, etc.)

Your Second Program: Math Operations

Let's create a program that performs calculations:

Step 1: Create Variables

  1. Go to Variables category
  2. Click "Create variable" and name it "number1"
  3. Create another variable named "number2"

Step 2: Set Values

  1. Drag "set number1 to" block to workspace
  2. Add a number block (value: 10)
  3. Drag "set number2 to" block
  4. Add a number block (value: 5)

Step 3: Perform Calculation

  1. Drag "print" block
  2. Add "text join" block to combine text and numbers
  3. Add "number1 + number2" math block
  4. Add text "The sum is: "

Your program should look like:

set number1 to 10
set number2 to 5
print "The sum is: " + (number1 + number2)

Step 4: Run and See Results

Click "Run Code" to see the calculation result!

Working with Loops

Let's create a program that counts from 1 to 5:

Step 1: Create a Loop

  1. Go to Loops category
  2. Drag "repeat 5 times" block
  3. Add "print" block inside the loop

Step 2: Add Counter

  1. Create a variable named "counter"
  2. Set counter to 1 before the loop
  3. Print counter inside the loop
  4. Increment counter by 1 inside the loop

Your program should look like:

set counter to 1
repeat 5 times:
  print counter
  set counter to counter + 1

Drone Control (Optional)

If you have a drone connected, try this simple flight sequence:

Step 1: Connect to Drone

  1. Click "Connect Server" button
  2. Wait for "Connected" status
  3. Check the floating telemetry window for drone data

Step 2: Create Flight Program

  1. Go to Drone Commands category
  2. Drag "takeoff" block (set altitude to 2.0)
  3. Add "hover" block (set duration to 3 seconds)
  4. Add "land" block

Step 3: Execute Flight

  1. Click "Run Code"
  2. Watch the terminal for flight progress
  3. Monitor telemetry in the floating window

Tips for Success

Best Practices

  • Start simple - Begin with basic programs before complex ones
  • Test frequently - Run your code often to catch errors early
  • Use meaningful names - Name variables and functions clearly
  • Comment your code - Add text blocks to explain what you're doing

Common Mistakes

  • Forgetting to connect blocks - Make sure blocks are properly connected
  • Missing variable declarations - Create variables before using them
  • Infinite loops - Be careful with loop conditions
  • Type mismatches - Ensure you're using the right data types

Getting Help

  • Hover over blocks - See tooltips with explanations
  • Check the terminal - Error messages will help you debug
  • Use the examples - Look at the provided examples for inspiration
  • Read the documentation - Detailed guides are available

Next Steps

Now that you've created your first programs:

  1. Explore more blocks - Try different categories and combinations
  2. Read the Block Reference - Learn about all available blocks
  3. Try the Examples - See more complex programs
  4. Learn about Drone Control - If you have a drone
  5. Check out Advanced Features - Learn about code generation

Troubleshooting

Program Won't Run

  • Check block connections - Make sure all blocks are properly connected
  • Look at the terminal - Error messages will tell you what's wrong
  • Verify syntax - Check the generated Python code for errors

Blocks Won't Connect

  • Check block types - Some blocks only connect to specific types
  • Look at the shapes - Matching shapes indicate compatible connections
  • Try different positions - Sometimes blocks need to be positioned just right

Drone Issues

  • Check connection - Ensure the drone server is running
  • Verify network - Make sure you can reach the drone
  • Check battery - Ensure the drone has sufficient power

Ready to dive deeper? Check out the User Guide for detailed instructions on all features!