Introduction

LiteWing Blockly is a visual programming app for the LiteWing Drone. Instead of writing every command by hand, you build programs by joining blocks together. The app shows the Python code created from your blocks, so learners can learn programming concepts while they create real drone programs.

LiteWing Blockly is fully portable. The Python, LiteWing library, and the app dependencies are included with the application. You do not need to install Python or any separate programming packages before using the app.

Requirements

You need the following items before using LiteWing Blockly:

Requirement Details
LiteWing Drone A LiteWing Drone & Positioning Module is required for LiteWing Blockly. The app uses the module’s Time of Flight height sensor and optical flow sensor for stable height hold, position hold, telemetry, and autonomous flight commands.
LiteWing Drone Positioning Module
Firmware LiteWing firmware version v3.0.0 or later.
System A Windows PC (64-bit) or Mac (Apple Silicon) with Wi-Fi.

Before continuing, install the Drone Positioning Module and update the LiteWing firmware. Check the Drone Positioning Module installation guide and the LiteWing firmware update guide before proceeding.

NOTE: LiteWing Blockly is not usable without the Drone Positioning Module and compatible firmware.

Download LiteWing Blockly

After downloading, open LiteWing Blockly. The app opens with the programming workspace, a console, and a connection bar along the bottom of the window.

Download LiteWing Blockly

Standalone application for Windows (64-bit) and macOS (Apple Silicon). Python 3.10 and LiteWing drivers pre-installed.

GitHub Repository

Get familiar with the app

Spend a few minutes exploring the application before you connect or fly. This makes it easier to understand where blocks go and where the app reports connection and flight information.

Category Toolbox in LiteWing Blockly
Category Toolbox

Category toolbox

The category toolbox is the vertical list on the left side of the app. It groups blocks by purpose, making it easier to find the command or value you need. Select a category such as Flight, LEDs, or Sensors to view the blocks available in that group.

Flyout Toolbox showing individual blocks
Flyout Toolbox

Flyout toolbox

The flyout toolbox opens beside the category toolbox after you select a category. It displays the individual blocks in that category. Drag a block from this panel into the workspace to begin building your program. The flyout changes whenever you choose a different category.

Workspace

The workspace is the large dotted area in the middle of the window. This is the main programming area, where you drag in blocks, connect them into stacks, move them around, and organise your program. Blocks connected in a vertical stack run from top to bottom.

LiteWing Blockly Programming Workspace
Programming Workspace Canvas
Control Function
Zoom in (+) Makes blocks larger for easier viewing and editing.
Zoom out (-) Gives you more workspace area when working with a large program.
Centre / Reset Returns the workspace to a comfortable default view.
Trashcan Deletes a block or connected block stack dropped onto it. Opening the trashcan can also display recently deleted blocks.
Real-time Generated Python Code Panel
Generated Python Code Panel

Python panel

The Python panel shows the Python code generated from the blocks in your workspace. It updates whenever you add, remove, or change a block. Use it to see how visual Blockly instructions translate into Python commands and understand what each block means in Python. Use Copy to copy the generated code or Export to save it as a Python file.

Live Telemetry Cockpit Sensors Panel
Sensors Cockpit Telemetry

Sensors panel

The Sensors panel displays live telemetry from the drone after it has been connected successfully. Depending on the available sensors, it can show information such as battery voltage, height, attitude, heading, and position. Check this panel before flight to confirm that live data is being received.

Interactive Terminal Console Output
Terminal Console Output

Console

The console displays text feedback from the app and your program. It shows connection messages, program output, warnings, and errors. If a connection or program does not work as expected, check the console first for useful details.

Status Bar and Connection Controls
Status Bar & Connection Indicator

Status bar

The status bar is at the bottom of the app window. It shows whether the drone is connected, displays the drone IP address, SSID name, connection strength, and battery voltage, and contains the Connect or Disconnect button. Confirm that the connection status is green before running a drone program.

Toolbar controls

Drone controls

Run Code Button
Run Code Button

Run code

Select Run code to start the program connected below a When Run clicked block. The app checks for a drone connection before it sends flight commands, so make sure the connection status is green and telemetry is available before running a flight program.

Land Button
Land Button

Land

Select Land to command a controlled landing and stop the active flight program. Use this button when the drone needs to finish a normal flight safely. Use this control rather than Stop whenever the situation is not an emergency.

Emergency Stop Button
Emergency Stop Button

Stop

Select Stop only in an emergency. It immediately cuts power to the motors, causing the drone to fall rather than land under control. The Spacebar performs the same emergency stop, which can be useful when you need to react quickly.

App and workspace controls

Undo Button Redo Button
Undo & Redo Controls

Undo and Redo

Use Undo to reverse the most recent change in the Blockly workspace, such as moving, deleting, connecting, or editing a block. Use Redo to restore a change that was undone. These controls affect the workspace only, they do not reverse a program that has already run on the drone.

Theme Toggle
Theme Toggle

Theme

Use Theme to switch between the Light & Dark app colour themes. This changes the appearance of the LiteWing Blockly interface but does not change your blocks, generated Python code, connection settings, or saved projects.

Save Project Button
Save Project Button

Save

Use Save to store the current Blockly workspace as a .lwb LiteWing Blockly project file. The saved project keeps the block arrangement, block settings, variables, and comments so you can continue working later. Save regularly, especially before closing the app or making major changes to a working flight program.

Load Project Button
Load Project Button

Load

Use Load to open a previously saved .lwb LiteWing Blockly project file. Loading a project restores its saved workspace so you can review, edit, test, or run the program again. Check the blocks, connection status, and flight area before running a loaded drone program.

Blockly Right-Click Context Menu
Context Menu Options

Context menu

Context menu opens when you right-click a block or the empty workspace. It can duplicate a block, add a comment, change input layout, collapse or disable a block, delete a block, or clean up loose stacks.

Blockly programming basics

Blocks and block stacks

A block represents one instruction, value, or event. A block stack is a vertical or horizontal sequence of connected command blocks. The program runs from the top of the stack to the bottom.

For example, a basic flight stack connects When Run clicked, Arm drone, Takeoff, Hover, and Land sequentially.

Basic Autonomous Flight Block Stack
Basic Flight Block Stack

Insertion marker

When you drag a compatible block near a connection point, Blockly shows an insertion marker. The marker shows where the block will be placed when you release it. Use the marker to insert a command between two existing commands without breaking the stack.

Blockly Connection Insertion Marker
Blockly Insertion Marker

Connection types

Connection Block Description Example
Next connection
Next Connection Notch
A notch at the bottom of a command block. It accepts the next command. Arm drone followed by Takeoff.
Previous connection
Previous Connection Notch
A notch at the top of a command block. It connects below the previous command. Land below Hover.
Output connection
Output Connection Plug
A rounded or angled plug that supplies a value. Battery voltage used in a comparison.
Statement input
Statement Input Notch (C-Mouth)
A socket that receives a value or stack of blocks. Waypoints inside Fly path or commands inside a loop.

Block icons and editable values

The gear icon gives additional conditional logic, you can drag the logic you wanted into the existing field to modify the block structure. In number fields such as 0.3, drop-down menus such as Increase, and text fields such as flight_log.csv are editable. Click a field, enter a suitable value, and press Enter.

Mutator Gear Icon Settings
Mutator Settings Gear
Editable Number and Dropdown Fields
Editable Input Fields

Some inputs contain a light-coloured shadow block. A shadow block is a safe default value. You can edit it or replace it by dropping another compatible value block into the same socket.

Safety before flight

Read these safety instructions before running any program on the LiteWing drone.

  • Place the drone on a flat, well-lit, textured floor. The optical flow sensor needs visible surface texture to track horizontal movement reliably.
  • Check that the propellers rotate freely and are free of hair, dust, or damage.
  • Use a charged battery. Do not start a flight when the battery is low.
  • Keep a clear landing area below the drone throughout the program.
  • Use Land for a normal, controlled landing. Use Stop or Spacebar only when continued flight is unsafe. Stop cuts motor power immediately, so the drone drops.
NOTE: The Drone Positioning Module must be installed correctly and firmware v3.0.0 or later must be running before flight commands are used.

Connect LiteWing Blockly to the Drone

Connecting to LiteWing Wi-Fi Network
Wi-Fi Connection Setup

To connect LiteWing Blockly to the drone, first place LiteWing on a flat surface and power it on. Allow the drone to complete its normal startup process before continuing.

On the computer, open the Wi-Fi settings and connect to the LiteWing Wi-Fi network. And you can verify this by the drone position module indication turned solid green, launch the LiteWing Blockly application and check the drone IP address shown in the connection bar. The normal default IP address is 192.168.43.42. Select Connect and wait for the application to verify the connection. Once the connection is established, LiteWing Blockly will begin receiving telemetry data from the drone.

A successful connection is confirmed when the connection status changes to Drone connected, with the status indicator turning green. The console should also report successful connection activity, while the Sensors tab begins displaying live telemetry data. The drone link indicator will flash while the application remains connected to LiteWing.

Connection Confirmation & Status
Connection Confirmation & Status

If the console reports that the computer is not connected to the LiteWing Wi-Fi network, return to the computer’s Wi-Fi settings and connect to the drone’s network. Once connected, return to LiteWing Blockly and select Connect again.

First programs

Connection Test LED Sequence Stack
Connection Test LED Routine

Connection Test

Use an LED program before any flight program. Verify that the app can connect to LiteWing and run code.

Select Run code. The LEDs should turn blue, blink for three seconds, and then turn off. If this does not happen, check the console and connection status before continuing.

First Controlled Flight Block Stack
First Flight Routine

First controlled flight

Use this program only after the LED test works and the flight area is clear.

This program arms the drone, takes off to 0.3 m, holds position for three seconds, and lands. Keep one hand ready to use Land or, only in an emergency, Stop or Spacebar.

LiteWing block reference

The sections below describe every LiteWing-specific block in the app. Each entry explains the block’s purpose, the Python instruction created by the app, the values you can set, and a small example of where the block belongs in a program.

Most flight blocks are command blocks. They run once, then continue to the next block below them. Sensor and modifier blocks are value blocks. They supply information or settings to another block and do not run by themselves. Standard Blockly blocks are covered after the LiteWing blocks.

Events

Events

When Run clicked

litewing_when_run
Block Structure
When Run Clicked Block

‘When Run clicked’ block starts a normal LiteWing Blockly program. Blocks connected below run from top to bottom when you select Run code. Think of it as the green flag for an autonomous mission, it tells the app where the main program begins.

Use one at the top of each flight program. You can arrange and store multiple programming block stacks in the same workspace at the same time.

By moving the blocks connected below When Run clicked, you can choose which programming block stack runs when you select Run code. This is useful when you want to keep several program ideas in one workspace but run only one at a time.

Generated Python
from litewing import LiteWing
import time

drone = LiteWing("192.168.43.42")
drone.connect()

# (No main sequence attached)

drone.disconnect()

Parameters: None.

Returns: None. It provides a connection for the command stack below it.

Example Routine in Blockly Workspace
When Run Clicked Example Routine
Events

When key pressed

litewing_when_key
Block Structure
When Key Pressed Event Block

‘When key pressed’ block sets up an asynchronous keyboard teleoperation handler. When you press the configured key on your physical keyboard while the LiteWing Blockly window is active, the attached sub-routine runs immediately.

Unlike a normal top-to-bottom stack, a key-event stack waits for the chosen key instead of running once and ending. This makes it useful for interactive programs.

Generated Python
from litewing import LiteWing
import time

drone = LiteWing("192.168.43.42")
drone.connect()

def on_key_pressed(key):
    print(f"Key EVENT: {key.upper()} triggered")
    if key == 'w':
        pass

drone.on_key_press(on_key_pressed)

# (No main sequence attached)
# Keeping script alive for key events
while drone.is_connected:
    time.sleep(0.5)

drone.disconnect()
Parameter Type Options Default
KEY Dropdown W, A, S, D, Q, E, R, F, Arrow Keys W

Returns: None. It provides a connection for commands below it.

Example Routine in Blockly Workspace
Keyboard Teleoperation Example Stack

Flight Commands

Flight Commands

Arm drone

litewing_arm
Block Structure
Arm Drone Block

Arm drone block prepares the drone for flight. It tells the connected LiteWing controller that the program is about to use flight commands and gives the flight system a chance to confirm that it is ready for takeoff. An arming does not lift the drone or make it move by itself.

An Arm drone block must be used before a Takeoff block. Place it after any LED-ready indication or logging setup and immediately before the first takeoff in a basic program.

Generated Python
drone.arm()

Parameters: None

Returns: None

Example Routine in Blockly Workspace
Arm Drone Sequence Example
Flight Commands

Takeoff

litewing_takeoff
Block Structure
Takeoff Block

Takeoff block makes the drone take off. The LiteWing Drone rises to the selected height above the ground, using the Drone Positioning Module’s downward-facing height sensor as part of the height-hold system. A Takeoff block must be used after an Arm drone and before any flight movement.

Takeoff is an autonomous command, not a manual throttle control. After reaching the selected height, use Hover or another flight command to define what happens next.

Generated Python
drone.takeoff(height) or drone.takeoff(height, duration)
Parameter Type Default Range Units
HEIGHT Number field 0.3 0.2 to 1.0 meters (m)
DURATION Value input (optional) None Any Number block or litewing_duration seconds (s)

Returns: None.

NOTE: Start at 0.3 m for the first flight. The takeoff height can be modified after a safe test.
Example Routine in Blockly Workspace
Takeoff and Hover Example
Flight Commands

Hover

litewing_hover
Block Structure
Hover Block

Hover block makes the drone hold its current position for a chosen time. The Drone Positioning Module uses its height sensor and optical-flow sensor to help the drone maintain a stable hover.

During a hover, the height sensor measures distance to the ground while the optical-flow sensor measures movement across the floor texture. The flight controller uses these measurements to correct small height and position changes. A plain, dark, glossy, or poorly lit floor can reduce optical-flow accuracy.

Generated Python
drone.hover(seconds)
Parameter Type Default Range Units
SECONDS Number field 3 3 to 60 seconds (s)

Returns: None.

NOTE: Use Hover after takeoff and between movement commands so the drone can stabilize.
Example Routine in Blockly Workspace
Hover Sequence Example
Flight Commands

Change height

litewing_change_height
Block Structure
Change Height Block

This block changes the current hover height by a relative amount. It does not set an absolute height. For example, if LiteWing is hovering at 0.3 m, increasing height by 0.1 m requests a new height of about 0.4 m.

Use this block after takeoff while the drone is already in a stable hover. It is useful for simple step-up and step-down activities, but large changes are not recommended for a first indoor program.

Generated Python
drone.change_height(delta, min_h=0.15, max_h=2.5)
Parameter Type Default Options / Range Units
DIRECTION Dropdown Increase Increase (+1.0), Decrease (-1.0) –
AMOUNT Float 0.1 0.1 to 1.0 meters (m)

Returns: None.

NOTE: Use small changes indoors. The generated command applies a 0.15 m to 1.0 m safety range.
Example Routine in Blockly Workspace
Change Height Staircase Flight Example
Flight Commands

Land

litewing_land
Block Structure
Land Block

Land block makes the drone descend in a controlled way and stop its motors after touchdown. Put a Land block at the end of every flight program.

Land is the normal way to finish a flight because it requests a controlled descent. It is different from Emergency Stop, which removes motor power immediately.

Generated Python
drone.land() or drone.land(duration)
Parameter Type Default Range Units
DURATION (optional) Value input (Float) 1 0.1 to 10 seconds (s)

Returns: None.

Example Routine in Blockly Workspace
Land Sequence Example
Flight Commands

Emergency stop

litewing_emergency_stop
Block Structure
Emergency Stop Block

This block immediately cuts motor power. The drone will fall, so this block is only for an emergency such as an imminent collision, propeller entanglement, or loss of safe control.

Emergency Stop is deliberately different from a landing command. It prioritises stopping the propellers over maintaining altitude, which is why it should never be used as the usual last block of a flight program.

Generated Python
drone.emergency_stop()

Parameters: None.

Returns: None.

NOTE: Use Land for normal flight completion. Stop and Spacebar are emergency controls.
Example Routine in Blockly Workspace
Emergency Stop Conditional Example

LEDs & Lights Commands

LEDs & Lights

Set all LEDs color

litewing_set_led_color
Block Structure
Set All LEDs Color Block

This block sets all four LEDs on the Drone Positioning Module to one RGB colour. It is useful for a safe connection test or for showing a program state, such as green for ready, blue for connected, or red for a warning.

RGB colour uses three light levels: red, green, and blue. A value of 0 turns that colour channel off and 255 gives its highest intensity. Combining channels creates other colours, such as yellow from red 255, green 255, and blue 0\.

Generated Python
drone.set_led_color(r, g, b)
Parameter Default Range Description
R 0 0 to 255 Red channel intensity.
G 255 0 to 255 Green channel intensity.
B 0 0 to 255 Blue channel intensity.

Returns: None.

Example Routine in Blockly Workspace
Set All LEDs Color Flight Status Example
LEDs & Lights

Set single LED

litewing_set_led
Block Structure
Set Single LED Block

This block sets one selected LED to an RGB colour. The LED index identifies one of the four LEDs on the Drone Positioning Module, allowing a program to create patterns instead of using a single all-LED colour.

Generated Python
drone.set_led(index, r, g, b)
Parameter Type Default Range Description
INDEX Dropdown 0 0, 1, 2, 3 Index of the target LED on the drone arms.
R Number field 255 0 to 255 Red channel intensity.
G Number field 0 0 to 255 Green channel intensity.
B Number field 0 0 to 255 Blue channel intensity.

Returns: None.

Example Routine in Blockly Workspace
Navigation Lights Single LED Example
LEDs & Lights
litewing_blink_leds
Block Structure
Blink LEDs Block

This block makes all LEDs blink using the selected off and on times. The off time tells the app how long the LEDs stay dark, the on time tells it how long the LEDs stay illuminated.

Generated Python
drone.blink_leds(off_ms, on_ms)
Parameter Type Default Range Units Description
OFF_MS Number field 500 50 to 5000 ms Milliseconds LEDs stay turned OFF per cycle.
ON_MS Number field 500 50 to 5000 ms Milliseconds LEDs stay turned ON per cycle.

Returns: None.

Example Routine in Blockly Workspace
Blink LEDs Alarm Example
LEDs & Lights

Clear all LEDs

litewing_clear_leds
Block Structure
Clear All LEDs Block

This block turns all four LEDs off. Use it to finish a visual test cleanly or to remove a status colour after a program is complete.

Generated Python
drone.clear_leds()

Parameters: None.

Returns: None.

Example Routine in Blockly Workspace
Clear All LEDs Touchdown Example

Movement Commands

Movement blocks are flight commands. Use them only after Arm drone and Takeoff. A speed value can be placed in the open socket of a movement block.

These are distance-based commands, not continuous joystick controls. The drone completes the requested movement, then the next block in the stack runs. Begin with short distances and add a Hover block after a movement when you want the drone to settle before the next command.

Movement

Pitch forward

litewing_pitch_forward
Block Structure
Pitch Forward Block

Pitch forward block moves the drone forward along its longitudinal X-axis by the selected distance. “Forward” means the direction LiteWing is facing when the command runs, so a rotation changes the direction of a later forward command.

Generated Python
drone.pitch_forward(distance) or drone.pitch_forward(distance, speed=value)
Parameter Type Default Range Units Description
DISTANCE Number field 0.3 0.1 to 2.0 meters (m) Linear distance to translate forward.
SPEED (optional) Value input None 0.1 to 2.0 m/s Optional translation velocity. Defaults to 0.2 m/s.

Returns: None.

Example Routine in Blockly Workspace
Pitch Forward Linear Translation Example
Movement

Pitch backward

litewing_pitch_backward
Block Structure
Pitch Backward Block

Pitch backward block moves the drone backward along its longitudinal X-axis by the given distance.

Generated Python
drone.pitch_backward(distance) or drone.pitch_backward(distance, speed=value)
Parameter Type Default Range Units Description
DISTANCE Number field 0.3 0.1 to 2.0 meters (m) Linear distance to translate backward.
SPEED (optional) Value input None 0.1 to 2.0 m/s Optional translation velocity. Defaults to 0.2 m/s.

Returns: None.

Example Routine in Blockly Workspace
Pitch Backward Return Leg Example
Movement

Roll left

litewing_roll_left
Block Structure
Roll Left Block

Roll left block moves the drone laterally to the left along its transverse Y-axis by the selected distance. Left and right are relative to the drone’s current heading, not to the person watching it from the side of the room.

Generated Python
drone.roll_left(distance) or drone.roll_left(distance, speed=value)
Parameter Type Default Range Units Description
DISTANCE Number field 0.3 0.1 to 2.0 meters (m) Linear distance to translate leftward.
SPEED (optional) Value input None 0.1 to 2.0 m/s Optional translation velocity. Defaults to 0.2 m/s.

Returns: None.

Example Routine in Blockly Workspace
Roll Left Lateral Shift Example
Movement

Roll right

litewing_roll_right
Block Structure
Roll Right Block

Roll right block moves the drone laterally to the right along its transverse Y-axis by the selected distance. Plan enough space on both sides of the flight area before using this block.

Generated Python
drone.roll_right(distance) or drone.roll_right(distance, speed=value)
Parameter Type Default Range Units Description
DISTANCE Number field 0.3 0.1 to 2.0 meters (m) Linear distance to translate rightward.
SPEED (optional) Value input None 0.1 to 2.0 m/s Optional translation velocity. Defaults to 0.2 m/s.

Returns: None.

Example Routine in Blockly Workspace
Roll Right Lateral Shift Example
Movement

Rotate left (Yaw)

litewing_rotate_left
Block Structure
Rotate Left (Yaw) Block

This block rotates the drone counter-clockwise around its vertical axis. Rotation is also called yaw, it changes where the front of the drone points without asking it to travel forward or sideways.

Generated Python
drone.rotate_left(degrees)
Parameter Type Default Range Units
DEGREES Number field 90 0 to 360 Degree

Returns: None.

NOTE: A rotation changes the direction used by later forward and backward movement.
Example Routine in Blockly Workspace
Rotate Left 360 Degree Scan Example
Movement

Rotate right (Yaw)

litewing_rotate_right
Block Structure
Rotate Right (Yaw) Block

This block rotates the drone clockwise around its vertical axis. Use modest angles such as 45 or 90 degrees while learning, then allow the drone to stabilise before the next movement.

Generated Python
drone.rotate_right(degrees)
Parameter Type Default Range Units
DEGREES Number field 90 0 to 360 Degree

Returns: None.

Example Routine in Blockly Workspace
Rotate Right Inspection Example

Navigation blocks work from the launch reference point. In the coordinate system used by LiteWing, positive X is forward, negative X is backward, positive Y is left, and negative Y is right.

Unlike a simple Pitch or Roll movement, a navigation command asks LiteWing to reach a named location. The X and Y values are measured in metres from the point where the flight began. Begin with a small coordinate such as X 0.3, Y 0.0 before creating larger paths.

Navigation

Fly to coordinates

litewing_fly_to
Block Structure
Fly To Coordinates Block

This block makes the drone fly to a selected X and Y coordinate. You can add Z, rotation, and speed modifier blocks to the open parameter socket.

For example, X 0.5 and Y 0.0 asks LiteWing to fly about half a metre forward from the launch point. X 0.0 and Y 0.3 asks it to move about 0.3 m left. The block can be used repeatedly to build a route one target at a time.

Generated Python
drone.fly_to(x, y, z, yaw, speed=value)
Parameter Type Default Range Units Description
X Number field 0.0 -5.0 to 5.0 meters (m) Forward/backward displacement (+X = forward).
Y Number field 0.0 -5.0 to 5.0 meters (m) Left/right displacement (+Y = left).
Z Number field(optional) 0.3 0.3 to 2.0 meters (m) Up/down displacement (+Z = up).
YAW Number field(optional) 90 -360 to 360 degrees Rotation (deg)
SPEED Number field(optional) 0.2 0.1 to 2 m/s Navigation speed (m/s)

Returns: None.

NOTE: If no Z value is supplied, the app uses the Takeoff height from the workspace.
Example Routine in Blockly Workspace
Fly To Absolute Coordinate Example
Navigation

Fly path

litewing_fly_path
Block Structure
Fly Path Waypoints Block

This block makes the drone visit a sequence of waypoint blocks. Place waypoint blocks inside its waypoints area and optionally attach a speed value.

The waypoint stack is read from top to bottom. Each waypoint becomes one coordinate in the generated Python path list, so the order of the blocks is the order in which LiteWing visits the locations.

Generated Python
drone.fly_path(path_points, speed=value)
Parameter Type Default Description
SPEED Value input None Optional traversal velocity modifier.
WAYPOINTS Statement input Pre-populated 2 waypoints Contains one or more litewing_waypoint blocks snapped in sequence.

Returns: None.

Example Routine in Blockly Workspace
Fly Path Multi-Waypoint Mission Example
Navigation

Waypoint coordinate

litewing_waypoint
Block Structure
Waypoint Coordinate Block

This block defines X and Y points inside a Fly path block. It can accept Z and rotation modifiers. It is not a free-standing flight command, it only belongs inside the waypoint area of a Fly path block.

Generated Python
(0.3, 0.0, 0.3)  # Waypoint coordinate tuple (X, Y, Z)
Parameter Type Default Range Units Description
X Number field 0.0 -5.0 to 5.0 meters (m) Forward/backward displacement (+X = forward).
Y Number field 0.0 -5.0 to 5.0 meters (m) Left/right displacement (+Y = left).
Z Number field(optional) 0.3 0.3 to 2.0 meters (m) Up/down displacement (+Z = up).
YAW Number field(optional) 90 -360 to 360 degrees Rotation (deg)

Returns: a waypoint statement that connects inside the Fly path.

Example Routine in Blockly Workspace
Waypoint Coordinate Parameter Example

Shapes Commands

Shape blocks create predefined flight paths. Use them after takeoff. A duration block and a Face flight direction block can be connected to their parameter socket.

These blocks are a convenient introduction to autonomous flight patterns. They still require a clear flight area larger than the shape itself. Measure the available space before choosing a side length or diameter.

Shapes

Fly square

litewing_square
Block Structure
Fly Square Shape Block

This block makes the drone fly a square path. The specified length determines the distance of each side of the square. It generates and executes a four-sided trajectory, returning the drone to its original hover position after completing the pattern.

Generated Python
drone.square(length=value, duration=value, face_direction=value)
Parameter Type Default Range Units Description
LENGTH Number field 0.6 0.2 to 3.0 meters (m) Length of each side of the square.
DURATION Value input 1 0.1 to 10 seconds (s) Time period (s)
FACE_DIRECTION Bool True – – Heading behavior

Returns: None.

Example Routine in Blockly Workspace
Fly Square Geometric Mission Example
Shapes

Fly triangle

litewing_triangle
Block Structure
Fly Triangle Shape Block

This block enables the drone to fly an equilateral triangle path. The specified length determines the distance of each equal side. It generates and executes a precise three-sided trajectory with 60° interior turns, returning the drone to its original hover position after completing the pattern.

Generated Python
drone.triangle(length=value, duration=value, face_direction=value)
Parameter Type Default Range Units Description
LENGTH Number field 0.6 0.2 to 3.0 meters (m) Length of each side of the triangle.
DURATION Value input 1 0.1 to 10 seconds (s) Time period (s)
FACE_DIRECTION Bool True – – Heading behavior

Returns: None.

Example Routine in Blockly Workspace
Fly Triangle Geometric Mission Example
Shapes

Fly circle

litewing_circle
Block Structure
Fly Circle Shape Block

This block directs the drone along a smooth circular trajectory. Set the diameter in meters to determine the circle’s overall width, and ensure there is enough open space for the drone to complete the maneuver safely.

Generated Python
drone.circle(diameter=value, duration=value, face_direction=value)
Parameter Type Default Range Units Description
DIAMETER Number field 1.0 0.3 to 3.0 meters (m) Overall width of circle.
DURATION Value input 1 0.1 to 10 seconds (s) Time period (s)
FACE_DIRECTION Bool True – – Heading behavior

Returns: None.

Example Routine in Blockly Workspace
Fly Circle Smooth Trajectory Example
Shapes

Fly pentagon

litewing_pentagon
Block Structure
Fly Pentagon Shape Block

This block makes the drone fly in a regular pentagon pattern. The Length value specifies the length of each side, allowing the drone to trace a five-sided polygon with equal-length sides.

Generated Python
drone.pentagon(length=value, duration=value, face_direction=value)
Parameter Type Default Range Units Description
LENGTH Number field 0.6 0.2 to 3.0 meters (m) Length of each side of the pentagon.
DURATION Value input 1 0.1 to 10 seconds (s) Time period (s)
FACE_DIRECTION Bool True – – Heading behavior

Returns: None.

Example Routine in Blockly Workspace
Fly Pentagon Geometric Mission Example
Shapes

Face flight direction

litewing_face_direction
Block Structure
Face Flight Direction Modifier Block

This value block chooses whether the drone should point in its direction of travel during a shape path. Select True when the flight path should guide the drone’s heading and False when it does not need that behaviour.

Generated Python
face_direction=True or face_direction=False
Parameter Type Default Range Description
FACE_DIRECTION Bool True True / False Heading behavior

Returns: a navigation parameter for a compatible shape block.

Sensors Commands

Sensor blocks read telemetry from the connected drone. Telemetry is a stream of measurements sent from LiteWing to the app. A sensor reporter can be printed, stored in a variable, or used in a Logic comparison to make the program respond to what the drone measures.

Sensors

Battery voltage

litewing_get_battery
Block Structure
Battery Voltage Reporter Block

This reporter block reads the current battery voltage. It is an important safety value because a low 1S LiPo battery can reduce flight performance and should be charged before flight.

Parameters: none.

Generated Python
drone.battery

Returns: a float in volts.

NOTE: Do not fly when the battery is low. Charge the battery before the next flight.
Example Routine in Blockly Workspace
Battery Voltage Conditional Guard Example
Sensors

Height sensor

litewing_get_height
Block Structure
Height Sensor Reporter Block

This reporter block reads the current estimated height in metres. The value is based on the available position module height sensing and is especially useful for observing a hover or explaining how a condition can use real sensor data.

Parameters: none.

Generated Python
drone.height

Returns: a float in metres.

Example Routine in Blockly Workspace
Height Sensor Loop Example
Sensors

Position sensor

litewing_get_position
Block Structure
Position Sensor Reporter Block

This reporter block reads the estimated X and Y position relative to the launch point. The values are estimates, not a GPS location, and they depend on optical-flow tracking over a textured, well-lit surface.

Parameters: none.

Generated Python
drone.position

Returns: a position value containing X and Y coordinates.

Example Routine in Blockly Workspace
Position Sensor Telemetry Example
Sensors
litewing_print_sensor
Block Structure
Print Sensor Block

This block prints a selected telemetry value in the console. It is the simplest way to see a live value while testing a connection, a sensor, or a short flight program.

Parameters: Battery, Height, Position, or Velocity.

Generated Python
print(f"sensor: {drone.sensor}")

Returns: None.

Example Routine in Blockly Workspace
Print Sensor Console Readout Example

Logging Commands

Logging

Start logging

litewing_start_logging
Block Structure
Start Logging Block

This block starts recording available telemetry data into a CSV file. A CSV file can be opened later in a spreadsheet or data-analysis program.

Telemetry logging is useful for capturing flight data that can be reviewed after the flight. Start logging before the commands or flight sequence you want to analyze, and stop logging after the drone has landed.

Parameters: Battery, Height, Position, or Velocity.

Generated Python
drone.start_logging("filename.csv")

Returns: Telemetry Flight data.

Example Routine in Blockly Workspace
Start Logging Flight Mission Example
Logging

Stop logging

litewing_stop_logging
Block Structure
Stop Logging Block

This block stops recording and closes the current CSV file. Always use it after Start logging so the recorded file is finished correctly and can be opened later.

Parameters: Battery, Height, Position, or Velocity.

Generated Python
drone.stop_logging()

Returns: Telemetry Flight data.

Utilities Commands

Utilities

Speed modifier

litewing_speed
Block Structure
Speed Modifier Block

This value block supplies a movement or navigation speed. It does not run by itself, snap it into a compatible speed socket. A lower speed gives the flight controller more time to correct its position.

Generated Python
speed = 0.2  # Navigation speed in m/s
Parameter Type Default Range Units
SPEED Number field 0.2 0.1 to 2.0 m/s

Returns: Output connection (used by compatible movement and navigation blocks).

Utilities

Duration modifier

litewing_duration
Block Structure
Duration Modifier Block

This value block supplies a time to Takeoff, Land, or a shape command. It does not run by itself, snap it into the compatible input socket. With a shape block, duration controls the intended time for completing that path.

Generated Python
duration = 3  # Duration in seconds
Parameter Type Default Range Units Description
DURATION Value input 1 0.1 to 10 seconds (s) Time period (s)

Returns: a number that can be used by compatible commands.

Utilities

Debug mode

litewing_set_debug
Block Structure
Debug Mode Block

When Debug mode is on, the program can be tested while keeping the propellers inactive.

Debug mode is useful for checking block order, delays, console output, LED sequences, and sensor logic. It is not a flight simulator, It helps verify the program flow.

Generated Python
drone.debug_mode = True or drone.debug_mode = False

Returns:None.

NOTE: Turn Debug mode OFF before an intended flight. A Takeoff command will not produce normal motor operation while Debug mode is on.
Example Routine in Blockly Workspace
Debug Mode Dry-Run Simulation Example
Utilities

Wait (Sleep)

litewing_wait
Block Structure
Wait (Sleep) Block

This block pauses the program for a selected number of seconds. It is useful when a program needs to leave time between visible actions, such as changing an LED colour or fetching sensor value and clearing it later.

Parameters: 0.1 s to 60 s in 0.1-second steps.

Generated Python
time.sleep(seconds)

Returns: None.

Utilities
litewing_print
Block Structure
Print Message Block

This block prints a text message or compatible value in the console. Print is useful for making a program explain what it is doing, for example Starting LED test, Taking off, or Flight complete.

Generated Python
print(value)

Parameters: None.

Returns: text or a compatible value block.

Standard programming blocks

The lower part of the toolbox contains standard Blockly categories. These blocks make it possible to add decisions, repetition, calculations, data, variables, and reusable commands to drone programs.

Category Blocks available in LiteWing Blockly Typical use with LiteWing
Logic if, comparison, and/or, not, true/false Land if battery voltage is below a safe value.
Loops repeat, while/until, count with Repeat an LED pattern or a small movement sequence.
Math number, arithmetic, random integer Calculate a value or choose a random LED colour component.
Lists create list, repeat list item, length, is empty Store non-flight data or program values.
Text text, join text, print text Create console messages and labels.
Variables create, set, get, change variable Store a counter, a target value, or a test result.
Functions define function, call function Reuse a safe flight routine or LED sequence.

Standard block reference

Block What it does Python Inputs and returns Example use
if / else Runs one stack when a condition is true and another stack when it is false. if condition: and optional else: Takes a true/false condition and statement stacks. Returns nothing. Land when battery voltage is below 3.5 V.
comparison Compares two values using equals, not equals, less than, greater than, less than or equal to, or greater than or equal to. For example, drone.battery \< 3.5 Takes two values. Returns True or False. Compare Battery voltage with 3.5.
and / or Combines two conditions. and needs both conditions to be true, or needs either one to be true. first and second or first or second Takes two true/false values. Returns True or False. Check that the battery is healthy and the height is below a limit.
not Reverses a true/false value. not condition Takes one true/false value. Returns True or False. Use not with a condition that detects a completed task.
true / false Supplies a fixed true or false value. True or False No inputs. Returns True or False. Use it with a condition or an app setting that needs a Boolean value.
repeat Repeat the commands inside it a selected number of times. for count in range(times): Takes a number and a statement stack. Returns nothing. Blink LEDs three times or repeat a short movement routine.
while / until Repeats while a condition remains true, or until a condition becomes true. while condition: or while not condition: Takes a condition and a statement stack. Returns nothing. Keep checking a value during a supervised test.
count with Repeats commands while a variable counts from a start value to an end value. for number in range(start, end, step): Takes a variable, start, end, step, and statement stack. Returns nothing. Run a short sequence five times while counting its steps.
number Supplies a number. A numeric literal, such as 0.3 No inputs. Returns a number. Use it for a height, delay, distance, or comparison value.
arithmetic Adds, subtracts, multiplies, divides, or raises one number by another. For example, a \+ b Take two numbers. Returns a number. Calculate a new value before printing it.
random integer Selects a whole number between two limits. random.randint(from, to) Takes lower and upper limits. Returns a number. Select a random value for an LED colour component.
create list Creates a list of items. \[item1, item2\] Takes one or more values. Returns a list. Store non-flight data used by a lesson activity.
repeat list item Creates a list containing the same item a chosen number of times. \[item\] \* count Take an item and a count. Returns a list. Create a repeated data set for a programming exercise.
length of list Counts the items in a list. len(list) Take a list. Returns a number. Check how many stored values are available.
list is empty Checks whether a list contains no items. not list Take a list. Returns True or False. Prevent a program from reading an empty list.
text Supplies text characters. A quoted string, such as ‘Ready’ No inputs. Returns text. Print a message in the console.
join text Combines two or more pieces of text. A joined string expression Takes text values. Returns text. Build a message with a label and a variable value.
print text Displays a text value in the console. print(text) Takes text or a compatible value. Returns nothing. Show Flight complete after land.
set variable Stores a value in a named variable. name = value Takes a variable name and a value. Returns nothing. Store a selected flight count.
get variable Reads the value stored in a variable. name No inputs. Returns the stored value. Use the saved count in a repeat block.
change variable by Increases or decreases a numeric variable. name \+= value Take a variable and a number. Returns nothing. Count completed LED blink cycles.
define function Creates a reusable named group of commands. def function_name(): Takes a function name and a statement stack. Returns nothing until called. Define a reusable LED-ready sequence.
call function Runs a function created elsewhere in the workspace. function_name() Take the selected function name. Returns the function result, if any. Run the same LED-ready sequence before each supervised test.
NOTE: Do not create an uncontrolled or endless flight loop. Always include a clear landing condition, keep the workspace supervised, and test new program logic with Debug mode before flight.

Example: low-battery landing check

The following block idea combines a sensor reporter with standard Logic:

Low-Battery Landing Check Complete Block Stack
NOTE: A program should always contain a safe landing path. Test new logic with Debug mode first.

Troubleshooting

Problem What to check
The app says the drone is not connected Check that the computer is connected to LiteWing Wi-Fi, confirm the IP address, then select Connect again.
Sensors tab has no live values Confirm that the connection status is green and that the Drone Positioning Module is installed with compatible v3.0.0 or later firmware.
LED test does not run Read the console, check the Wi-Fi connection, and reconnect before running the program again.
The drone does not take off Confirm that the Arm drone comes before Takeoff, Debug mode is OFF, the battery is charged, and the positioning module and compatible firmware are installed.
The drone drifts Use a flat, well-lit, textured floor. Clean the optical-flow sensor area and keep the first movements short.
The drone needs to be stopped immediately Press Spacebar or select Stop. Remember that this cuts motor power and the drone falls.
Scroll to Top