> For the complete documentation index, see [llms.txt](https://luadoc.edgetx.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://luadoc.edgetx.org/lua-api-programming/input-table-syntax.md).

# Input Table Syntax

## Overview

The input table defines what values are available as input(s) to [mix scripts](https://github.com/EdgeTX/lua-reference-guide/blob/main/part_i_-_script_type_overview/mix.md). There are two forms of input table entries.

* **SOURCE syntax**

  ```lua
  { "<name>", SOURCE }
  ```

  SOURCE inputs provide the current value of a selected OpenTX variable. The source must set by the user when the mix script is configured. Source can be any value OpenTX knows about (inputs, channels, telemetry values, switches, custom functions,...).\
  \&#xNAN;*Note:* typical range is -1024 thru +1024. Simply divide the input value by 10.24 to interpret as a percentage from -100% to +100%.
* **VALUE syntax**

  ```lua
  { "<name>", VALUE, <min>, <max>, <default> }
  ```

  VALUE inputs provide a constant value that is set by the user when the mix script is configured.

  * *name* - maximum length of 8 characters
  * *min* - minimum value of -128
  * *max* - maximum value of 127
  * *default* - must be within the valid range specified
* **Maximum of 6 inputs per script (warning : was 8 in 2.1)**

## Example using a SOURCE and a VALUE

```lua
local input =
    {
        { "Strength", SOURCE},                -- user selects source (typically slider or knob)
        { "Interval", VALUE, 0, 100, 0 }    -- interval value, default = 0.
    }

local function run(strength, interval)
    -- variable strength will contain the current slider value
    -- variable interval is set by the user and constant through script lifetime

    -- this script has no return value but may use playFile() to alert user

    return
end

return {input=input, run=run}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://luadoc.edgetx.org/lua-api-programming/input-table-syntax.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
