Threads#

In Progress

Introduction#

Threads allow a drone to run multiple tasks simultaneously within the same program. They enable multitasking, letting the drone perform independent actions at the same time.

Note: You must first define a function to use it with a thread.

Constructor – Create and start new threads.

  • Thread – Starts a new thread that runs the specified function in parallel with the main program.

Action – Control running threads.

  • stop – Stops a thread manually, useful for halting background behavior.

Constructor#

Thread#

Thread creates and starts a thread. When you create a thread, you can name it to manage it individually in your project.

Usage:

my_thread = Thread(my_function)

Parameters

Description

my_thread

Optional. A name for the new thread.

callback

The name of a previously defined function.

Note: A function must always be defined before it is called.

# Example coming soon

Action#

stop#

stop stops a thread manually, which is useful when a task is no longer needed or when a program needs to reset or reassign threads.

Usage:

my_thread.stop()

Parameters

Description

This method has no parameters.

# Example coming soon