Lua skripty OpenTx2: Porovnání verzí
Z Wiki OpenTX
m |
|||
(Není zobrazeno 5 mezilehlých verzí od 3 dalších uživatelů.) | |||
Řádek 1: | Řádek 1: | ||
+ | <div style="max-width:780px; margin-left:0em;margin-right:autoů;text-align:justify"> | ||
+ | |||
+ | Anglický přehled Lua pro OpenTx: [http://rcdiy.ca/lua/ RCdiy > Introduction To OpenTX Lua Scripts] | ||
+ | |||
====Opentx 2.x přináší novinku v podobě možnosti skriptování v jazyce Lua.==== | ====Opentx 2.x přináší novinku v podobě možnosti skriptování v jazyce Lua.==== | ||
Řádek 6: | Řádek 10: | ||
* jednorázový skript, který provede nějakou operaci a poté se ukončí | * jednorázový skript, který provede nějakou operaci a poté se ukončí | ||
* skript který funguje neustále na pozadí | * skript který funguje neustále na pozadí | ||
− | + | * zatím poslední dokumentace (2020-06) najdete na stránkách [https://legacy.gitbook.com/book/opentx/opentx-2-3-lua-reference-guide/details GitBook] | |
====Speciálním použitím Lua skriptu je průvodce nastavením modelu.==== | ====Speciálním použitím Lua skriptu je průvodce nastavením modelu.==== | ||
− | Now - OpenTX 2.0.3 - we have 3 kinds of Lua scripts, the 3rd category is "function scripts" that are available in the Special Functions screen. | + | Now - OpenTX 2.0.3 - we have 3 kinds of Lua scripts, the 3rd category is "function scripts" that are available in the Special Functions screen.<br> |
− | I am adding a new (4th) category which will be the telemetry scripts. Theorically you will be able to have up to 7 custom telemetry screens, all written in Lua. | + | I am adding a new (4th) category which will be the telemetry scripts. Theorically you will be able to have up to 7 custom telemetry screens, all written in Lua.<br> |
− | Then we will have a 5th category which will be the templates scripts, those scripts will be available in a contextual menu, just as the Wizard. | + | Then we will have a 5th category which will be the templates scripts, those scripts will be available in a contextual menu, just as the Wizard.<br> |
− | One limitation (due to RAM usage) is on the scripts count, 7 is the maximum (shared in all categories). | + | One limitation (due to RAM usage) is on the scripts count, 7 is the maximum (shared in all categories).<br> |
− | Also in OpenTX 2.0.3 I changed the directories, here is the new structure on the SD card: | + | Also in OpenTX 2.0.3 I changed the directories, here is the new structure on the SD card:<br> |
− | /SCRIPTS/ | + | /SCRIPTS/<br> |
− | /SCRIPTS/MIXES/ | + | /SCRIPTS/MIXES/<br> |
− | /SCRIPTS/FUNCTIONS/ | + | /SCRIPTS/FUNCTIONS/<br> |
− | /SCRIPTS/WIZARD/ | + | /SCRIPTS/WIZARD/<br> |
− | In OpenTX 2.0.4 you will put your telemetry scripts like this (you will be able to have different scripts on a per model basis): | + | In OpenTX 2.0.4 you will put your telemetry scripts like this (you will be able to have different scripts on a per model basis):<br> |
− | /SCRIPTS/<MODELNAME>/telemXX.lua | + | /SCRIPTS/<MODELNAME>/telemXX.lua<br> |
− | And in OpenTX 2.0.5 you will put your templates scripts here: | + | And in OpenTX 2.0.5 you will put your templates scripts here:<br> |
− | /SCRIPTS/TEMPLATES/ | + | /SCRIPTS/TEMPLATES/<br> |
Enjoy! | Enjoy! | ||
Bertrand | Bertrand | ||
+ | </div> |
Aktuální verze z 4. 4. 2021, 18:00
Anglický přehled Lua pro OpenTx: RCdiy > Introduction To OpenTX Lua Scripts
Opentx 2.x přináší novinku v podobě možnosti skriptování v jazyce Lua.
Skripty Lua jsou jekési miniaplikace, které mohou doplnit funkčnost rádia o nevídané funkce. Jejich výhodou je jejich modulárnost. Nejsou součástí firmware, ale zpouští se přímo z SD karty. Mohou fungovat v několika režimech:
- jednorázový skript, který provede nějakou operaci a poté se ukončí
- skript který funguje neustále na pozadí
- zatím poslední dokumentace (2020-06) najdete na stránkách GitBook
Speciálním použitím Lua skriptu je průvodce nastavením modelu.
Now - OpenTX 2.0.3 - we have 3 kinds of Lua scripts, the 3rd category is "function scripts" that are available in the Special Functions screen.
I am adding a new (4th) category which will be the telemetry scripts. Theorically you will be able to have up to 7 custom telemetry screens, all written in Lua.
Then we will have a 5th category which will be the templates scripts, those scripts will be available in a contextual menu, just as the Wizard.
One limitation (due to RAM usage) is on the scripts count, 7 is the maximum (shared in all categories).
Also in OpenTX 2.0.3 I changed the directories, here is the new structure on the SD card:
/SCRIPTS/
/SCRIPTS/MIXES/
/SCRIPTS/FUNCTIONS/
/SCRIPTS/WIZARD/
In OpenTX 2.0.4 you will put your telemetry scripts like this (you will be able to have different scripts on a per model basis):
/SCRIPTS/<MODELNAME>/telemXX.lua
And in OpenTX 2.0.5 you will put your templates scripts here:
/SCRIPTS/TEMPLATES/
Enjoy! Bertrand