API reference¶
Generated from
lua-doc.zip (nightly26, fetched 2026-10-09, sha256 42165986832d).Namespaces¶
Global tables of functions, called with a dot: lcd.drawText(...).
| Namespace | Functions | Since |
|---|---|---|
bluetooth |
3 | 26.1.0 |
crsf |
1 | 1.6.0 |
form |
31 | 1.1.0 |
glasses |
4 | 26.1.0 |
lcd |
37 | 1.1.0 |
model |
16 | 1.1.0 |
multimodule |
1 | 1.6.0 |
serial |
1 | 1.1.0 |
simulator |
21 | 1.5.0 |
sport |
1 | 1.1.0 |
storage |
2 | 1.1.0 |
system |
36 | 1.1.0 |
Objects¶
Values returned by API calls, with methods called using a colon: source:value().
| Object | Methods | Typical source |
|---|---|---|
Bitmap |
3 | |
Channel |
8 | |
ChoiceLib |
3 | |
CrsfSensor |
2 | crsf.getSensor() |
Curve |
10 | |
ExpansionPanel |
5 | |
FormFieldLib |
3 | |
FrSkyStaticTextLib |
2 | |
GlassesLayout |
2 | glasses.createLayout() |
LogicSwitch |
10 | |
LuaSPortFrame |
6 | |
LuaSPortSensor |
11 | |
LuaSPortSerial |
5 | |
Module |
6 | |
MultimoduleSensor |
2 | multimodule.getSensor() |
NumberEditLib |
12 | |
SliderLib |
5 | |
Source |
23 | system.getSource() |
TimeEditLib |
1 | |
Timer |
15 |
Handle types with no methods of their own (passed between calls): Dialog, FormLine, LuaBitmapBase, LuaButton, LuaCrsfSensor, LuaFunctionRef, LuaMultimoduleSensor, WaitDialog.
Constants¶
205 global constants: fonts, theme colors, source categories, units, events and more.
Most used¶
The calls that real scripts use most, counted across the open-source projects listed in Real-world usage. Learn these first.
| Function | Calls | Projects |
|---|---|---|
form.addLine() |
667 | 11 |
lcd.RGB() |
637 | 11 |
lcd.color() |
601 | 11 |
lcd.drawText() |
409 | 13 |
lcd.drawFilledRectangle() |
354 | 12 |
lcd.font() |
323 | 11 |
lcd.getTextSize() |
259 | 10 |
lcd.loadMask() |
252 | 6 |
lcd.getWindowSize() |
231 | 13 |
form.addNumberField() |
229 | 6 |
form.clear() |
227 | 9 |
form.addStaticText() |
219 | 10 |
form.addChoiceField() |
188 | 9 |
lcd.invalidate() |
153 | 13 |
lcd.drawLine() |
133 | 9 |
What's new¶
Added in 26.1.3:
system.getInstructionsUsage(): Return the percentage of Lua instructions already used in the current script execution cycle.system.registerGlasses(): Register the ActiveLook glasses support (shows the Model / Glasses page)system.registerSensor(): Register an S.Port sensor definition, so that it gets recognized (name, unit, decimals, protocol min/max) when the sensors Discover finds an appId in this range, instead of falling back to a generic unnamed sensor.