
X20/X20S and Ethos v1.2.10 User Manual
Lua Scripts
Lua scripts allow you to create custom widgets to display information in the Ethos main views.
In future it will also allow you to modify the behavior of the radio to add specialized functions
for custom tasks, and to interface with flight controllers and the like.
The Lua scripting language is a lightweight embeddable scripting language and is designed to
be used for all sorts of applications from games to web applications and image processing, and
in this case for implementing custom functions in the radio.
ETHOS Lua Interpreter
The Lua interpreter embedded inside ETHOS is based on LUA 5.4.3. and is packaged with
these libraries:
•
basic library
•
table library
•
io library
•
os library
•
math library
ETHOS Lua Documentation
The ETHOS Lua documentation can be downloaded from the latest ETHOS release on GitHub
https://github.com/FrSkyRC/ETHOS-Feedback-Community/releases
. In the release look for the
lua-doc.zip and click on it to download. To open the documentation, double click on file name
index.html in the file list and the documentation will open in in your default web browser.
ETHOS Lua Example Script Files Location
The ETHOS Lua example script files are stored on
https://github.com/FrSkyRC/ETHOS-
Feedback-Community/tree/main/lua
. To download a file:
•
Open the above link in a web browser.
•
Navigate to the folder and then the main.lua file you want to download.
•
Click on the main.lua to open it and view the code.
•
Click on ‘Raw’.
•
Right-click the page and click ‘Save Page as’, then save the file as main.lua in your download
location.
•
To avoid clashes with other main.lua files, move the downloaded main.lua file into a suitably
named folder (suggest to use the same folder name as the one the file came from).
For other files like images:
•
Click on the file.
•
Click on ‘Download’. It will download into your browser.
•
Right-click the image and click ‘Save Image as’, then save the file (as for example
servo.png) in your download location.
The majority of the examples are for Lua widgets, which are configured in the
section. Another application for Lua scripts is to create System Tools, which appear
after ‘Info’ in the System section of the menus. Please refer to the ‘servo’ example for an
example System Tool.
Lua Scripting Configuration Limits
- 2MB for bitmaps (one full screen bitmap on X20 consumes 768K)
- 2MB for Lua scripts (this is a large amount)
162
rev 3
Summary of Contents for TANDEM X20
Page 1: ...X20 and Ethos User Manual...