Replies: 2 comments 6 replies
-
Are you sure it is stuck? From the looks of that script, it is not doing any manipulation of the screen, since Try adding a lcd.clear() and lcd.drawText() and see how you go then ;) e.g. local function runScript(event)
-- print("Hello, World!")
lcd.clear()
lcd.drawText(20, 20, "Hello, World!")
return 0
end
return { run = runScript } Please note, if you are working on a function script, per the documentation, function scripts DO NOT have access to the display ;) They are not the same as one time scripts, i.e. scripts that you run from tools/sd browser |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you for your response!
How can I view the console output? Is it by reading the SD card on the computer and then viewing it in the computer's Lua interpreter?
This is one of my test files. What I really want to achieve is to simulate pressing the SA button once after running the Lua script. During this process, no additional information will be displayed on the screen. This way, when I set the loop logic switch, I can let the remote control continuously send signals to the receiver. I've found that 0, 1, and 2 represent different states of the buttons, but how can I find the ID for the SA button?:)
…----- 原始邮件 -----
发件人: "Peter Feerick" ***@***.***>
收件人: "EdgeTX/edgetx" ***@***.***>
抄送: "une_glace" ***@***.***>, "Author" ***@***.***>
发送时间: 星期六, 2024年 9 月 14日 上午 10:58:21
主题: Re: [EdgeTX/edgetx] Can't run the lua scripts on 2.10.0 (Discussion #5534)
Are you sure it is stuck? From the looks of that script, it is not doing any manipulation of the screen, since `print("Hello, World!")` will go out the console, not screen.
Try adding a [lcd.clear()](https://luadoc.edgetx.org/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/clear) and [lcd.drawText()](https://luadoc.edgetx.org/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawtext) and see how you go then ;)
Please note, if you are working on a function script, [per the documentation](https://luadoc.edgetx.org/part_i_-_script_type_overview/function_scripts), function scripts DO NOT have access to the display ;)
--
Reply to this email directly or view it on GitHub:
#5534 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem Description:
TS16S radio gets stuck on loading when running a Lua script and doesn't proceed further.
Details:
Radio Model: TS16S
Firmware Version: 2.10.0
Issue Description:
I am trying to run a very simple Lua script on my TS16S radio:
After placing the script in the SCRIPTS/ or SCRIPTS/FUNCTIONS/directory on the SD card and executing it from the radio, the screen gets stuck on loading and doesn't move forward.
The script itself seems error-free, but it still doesn't execute properly.
Additionally, if the script has syntax errors, the radio correctly reports them, indicating that the Lua engine itself seems to be functioning.
Steps I've Tried:
Updated the firmware and checked the SD card file system to ensure there are no errors.
Verified that the script file is saved in UTF-8 encoding without a BOM.
Tried using different SD cards, but the issue persists.
Assistance Needed:
Has anyone encountered a similar issue?
Are there any other debugging methods or solutions I can try?
Could this be a compatibility issue with the firmware version?
Thx a lot!!
Beta Was this translation helpful? Give feedback.
All reactions