> 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/edgetx-v2.7/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd_functions-overview.md).

# Lcd Functions Overview

## Description

Lcd functions allow scripts to interact with the transmitter display. This access is limited to the `run` function of One-Time and Telemetry scripts, and the `refresh` function of Widget scripts on radios with color display.

## Notes:

The run function is periodically called when the screen is visible. In OpenTX 2.0 each invocation starts with a blank screen (unless lcd.lock() is used). Under OpenTX 2.1 screen state is always persisted across calls to the run function. **Many scripts originally written for OpenTX 2.0 require a call to lcd.clear() at the beginning of their run function in order to display properly under 2.1 and 2.2.**

For Widget scripts, `lcd.clear()` is not needed, as each invocation starts with a blank screen showing the theme background. But it can be used to overwrite the theme background with another color by calling `lcd.clear(color)`.

Please see above for a description of the constants for [flags and patterns](/edgetx-v2.7/part_iii_-_opentx_lua_api_reference/constants/flags-and-pattern-constants.md), [colors](/edgetx-v2.7/part_iii_-_opentx_lua_api_reference/constants/color-constants.md), and [screen size](/edgetx-v2.7/part_iii_-_opentx_lua_api_reference/constants/screen-constants.md) that can be used with lcd drawing functions.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://luadoc.edgetx.org/edgetx-v2.7/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd_functions-overview.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
