From 87881be92d46becba68b7adbbe2a124f23405377 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Mon, 2 Oct 2023 15:35:18 +1000 Subject: [PATCH 1/3] chore: cleanup --- advanced_topics/README.md | 4 + advanced_topics/debugging_techniques.md | 100 ++++++++ .../lua_data_sharing_across_scripts.md | 186 ++++++++++++++ advanced_topics/optimization_tricks.md | 27 +++ lua_api_programming_guide/README.md | 4 + ...ta-exchange-with-the-edgetx-model-setup.md | 103 ++++++++ .../drawing-flags-and-colors.md | 53 ++++ .../included_lua_libraries/README.md | 13 + .../included_lua_libraries/bit32.library.md | 4 + .../io-library/README.md | 52 ++++ .../io-library/io.close.md | 11 + .../io-library/io.open.md | 16 ++ .../io-library/io.read.md | 15 ++ .../io-library/io.seek.md | 15 ++ .../io-library/io.write.md | 13 + .../included_lua_libraries/math.library.md | 4 + .../included_lua_libraries/string.library.md | 4 + .../init_function_syntax.md | 18 ++ .../input_table_syntax.md | 51 ++++ .../loading-code-modules-dynamically.md | 37 +++ lua_api_programming_guide/lua-basics.md | 84 +++++++ .../output_table_syntax.md | 35 +++ .../return_statement_syntax.md | 22 ++ .../run_function_syntax.md | 47 ++++ lua_api_programming_guide/saving-memory.md | 174 ++++++++++++++ .../using-key-and-touch-events.md | 226 ++++++++++++++++++ lua_api_reference/README.md | 4 + lua_api_reference/bitmap/README.md | 2 + .../bitmap.resize-bitmap-width-height.md | 19 ++ .../bitmap/bitmap.tomask-bitmap.md | 17 ++ lua_api_reference/bitmap/getsize.md | 29 +++ lua_api_reference/bitmap/open.md | 34 +++ lua_api_reference/constants/README.md | 12 + .../constants/color-constants.md | 82 +++++++ .../constants/flags-and-pattern-constants.md | 38 +++ lua_api_reference/constants/key_events.md | 82 +++++++ .../logical-switch-function-constants.md | 25 ++ .../constants/screen-constants.md | 7 + .../constants/special-character-constants.md | 23 ++ .../constants/special-function-constants.md | 30 +++ .../constants/touch-event-constants.md | 37 +++ lua_api_reference/constants/widget-options.md | 33 +++ lua_api_reference/filesystem/README.md | 2 + .../filesystem/del-file-or-directory.md | 21 ++ lua_api_reference/filesystem/dir-directory.md | 24 ++ lua_api_reference/filesystem/fstat-path.md | 41 ++++ lua_api_reference/general/README.md | 2 + .../general/accesstelemetrypush.md | 21 ++ lua_api_reference/general/chdir.md | 14 ++ .../general/crossfiretelemetrypop.md | 17 ++ .../general/crossfiretelemetrypush.md | 18 ++ lua_api_reference/general/defaultchannel.md | 15 ++ lua_api_reference/general/defaultstick.md | 14 ++ lua_api_reference/general/flushaudio.md | 13 + .../general/getavailablememory.md | 12 + lua_api_reference/general/getdatetime.md | 20 ++ lua_api_reference/general/getfieldinfo.md | 27 +++ lua_api_reference/general/getflightmode.md | 18 ++ .../general/getgeneralsettings.md | 24 ++ lua_api_reference/general/getglobaltimer.md | 18 ++ .../general/getlogicalswitchvalue-id.md | 13 + .../general/getoutputvalue-outputindex.md | 12 + lua_api_reference/general/getras.md | 20 ++ lua_api_reference/general/getrotencmode.md | 14 ++ lua_api_reference/general/getrotencspeed.md | 14 ++ lua_api_reference/general/getrssi.md | 16 ++ lua_api_reference/general/getrtctime.md | 14 ++ lua_api_reference/general/getshmvar-id.md | 17 ++ .../general/getsourceindex-sourcename.md | 19 ++ .../general/getsourcename-sourceindex.md | 17 ++ .../general/getsourcevalue-source.md | 51 ++++ .../general/getswitchindex-positionname.md | 11 + .../general/getswitchname-switchindex.md | 11 + .../general/getswitchvalue-switchindex.md | 12 + lua_api_reference/general/gettime.md | 18 ++ lua_api_reference/general/gettxgps.md | 22 ++ lua_api_reference/general/getusage.md | 14 ++ lua_api_reference/general/getvalue.md | 48 ++++ lua_api_reference/general/getversion.md | 57 +++++ .../general/ghosttelemetrypop.md | 16 ++ .../general/ghosttelemetrypush.md | 17 ++ lua_api_reference/general/grey.md | 18 ++ lua_api_reference/general/killevents.md | 14 ++ lua_api_reference/general/loadscript.md | 49 ++++ lua_api_reference/general/multibuffer.md | 16 ++ lua_api_reference/general/playduration.md | 17 ++ lua_api_reference/general/playfile.md | 18 ++ lua_api_reference/general/playhaptic.md | 18 ++ lua_api_reference/general/playnumber.md | 19 ++ lua_api_reference/general/playtone.md | 21 ++ .../popupconfirmation-title-message-event.md | 20 ++ .../general/popupconfirmation.md | 20 ++ lua_api_reference/general/popupinput.md | 24 ++ lua_api_reference/general/popupwarning.md | 19 ++ lua_api_reference/general/resetglobaltimer.md | 20 ++ .../general/serialgetpower-port_nr.md | 14 ++ lua_api_reference/general/serialread.md | 16 ++ .../general/serialsetpower-port_nr-value.md | 16 ++ lua_api_reference/general/serialwrite.md | 16 ++ .../general/setserialbaudrate-baudrate.md | 14 ++ .../general/setserialbaudrate.md | 14 ++ .../general/setshmvar-id-value.md | 18 ++ .../general/setstickyswitch-id-value.md | 15 ++ .../general/settelemetryvalue.md | 25 ++ .../general/sources-first-last.md | 16 ++ .../general/sporttelemetrypop.md | 19 ++ .../general/sporttelemetrypush.md | 20 ++ .../general/switches-first-last.md | 16 ++ lua_api_reference/lcd/README.md | 2 + lua_api_reference/lcd/RGB.md | 31 +++ lua_api_reference/lcd/clear.md | 25 ++ lua_api_reference/lcd/drawBitmap.md | 30 +++ lua_api_reference/lcd/drawChannel.md | 26 ++ lua_api_reference/lcd/drawCombobox.md | 36 +++ lua_api_reference/lcd/drawFilledRectangle.md | 27 +++ lua_api_reference/lcd/drawGauge.md | 31 +++ lua_api_reference/lcd/drawLine.md | 32 +++ lua_api_reference/lcd/drawNumber.md | 30 +++ lua_api_reference/lcd/drawPixmap.md | 27 +++ lua_api_reference/lcd/drawPoint.md | 31 +++ lua_api_reference/lcd/drawRectangle.md | 29 +++ lua_api_reference/lcd/drawScreenTitle.md | 30 +++ lua_api_reference/lcd/drawSource.md | 25 ++ lua_api_reference/lcd/drawSwitch.md | 26 ++ lua_api_reference/lcd/drawText.md | 35 +++ lua_api_reference/lcd/drawTimer.md | 29 +++ lua_api_reference/lcd/drawannulus.md | 17 ++ lua_api_reference/lcd/drawarc.md | 17 ++ lua_api_reference/lcd/drawcircle.md | 16 ++ lua_api_reference/lcd/drawfilledcircle.md | 16 ++ lua_api_reference/lcd/drawfilledtriangle.md | 15 ++ lua_api_reference/lcd/drawhudrectangle.md | 16 ++ lua_api_reference/lcd/drawlinewithclipping.md | 17 ++ lua_api_reference/lcd/drawpie.md | 17 ++ lua_api_reference/lcd/drawtriangle.md | 15 ++ lua_api_reference/lcd/getColor.md | 23 ++ lua_api_reference/lcd/getLastLeftPos.md | 25 ++ lua_api_reference/lcd/getLastPos.md | 28 +++ lua_api_reference/lcd/getLastRightPos.md | 28 +++ .../lcd.drawbitmappattern-bitmap-x-y-flags.md | 19 ++ ...ie-bitmap-x-y-startangle-endangle-flags.md | 21 ++ .../lcd.drawtextlines-x-y-w-h-text-flags.md | 20 ++ lua_api_reference/lcd/lcd.exitfullscreen.md | 10 + .../lcd/lcd.invertrect-x-y-w-h-flags.md | 16 ++ .../lcd/lcd_functions-overview.md | 57 +++++ lua_api_reference/lcd/refresh.md | 23 ++ .../lcd/resetBacklightTimeout.md | 19 ++ lua_api_reference/lcd/setColor.md | 68 ++++++ lua_api_reference/lcd/sizetext.md | 15 ++ lua_api_reference/model/README.md | 2 + lua_api_reference/model/defaultinputs.md | 14 ++ lua_api_reference/model/deleteflightmodes.md | 14 ++ lua_api_reference/model/deleteinput.md | 15 ++ lua_api_reference/model/deleteinputs.md | 14 ++ lua_api_reference/model/deletemix.md | 15 ++ lua_api_reference/model/deletemixes.md | 14 ++ lua_api_reference/model/getcurve.md | 26 ++ lua_api_reference/model/getcustomfunction.md | 22 ++ lua_api_reference/model/getflightmode.md | 25 ++ lua_api_reference/model/getglobalvariable.md | 25 ++ lua_api_reference/model/getinfo.md | 18 ++ lua_api_reference/model/getinput.md | 26 ++ lua_api_reference/model/getinputscount.md | 14 ++ lua_api_reference/model/getlogicalswitch.md | 21 ++ lua_api_reference/model/getmix.md | 31 +++ lua_api_reference/model/getmixescount.md | 14 ++ lua_api_reference/model/getmodule.md | 49 ++++ lua_api_reference/model/getoutput.md | 25 ++ lua_api_reference/model/getsensor.md | 22 ++ lua_api_reference/model/gettimer.md | 22 ++ lua_api_reference/model/insertinput.md | 16 ++ lua_api_reference/model/insertmix.md | 16 ++ lua_api_reference/model/model.getswashring.md | 21 ++ .../model/model.setswashring-params.md | 17 ++ lua_api_reference/model/resetsensor.md | 14 ++ lua_api_reference/model/resettimer.md | 14 ++ lua_api_reference/model/setcurve.md | 45 ++++ lua_api_reference/model/setcustomfunction.md | 18 ++ lua_api_reference/model/setflightmode.md | 15 ++ lua_api_reference/model/setglobalvariable.md | 18 ++ lua_api_reference/model/setinfo.md | 18 ++ lua_api_reference/model/setlogicalswitch.md | 21 ++ lua_api_reference/model/setmodule.md | 19 ++ lua_api_reference/model/setoutput.md | 19 ++ lua_api_reference/model/settimer.md | 19 ++ script_type_overview/README.md | 8 + script_type_overview/function_scripts.md | 52 ++++ script_type_overview/mix.md | 113 +++++++++ script_type_overview/one-time_scripts.md | 56 +++++ script_type_overview/telemetry.md | 51 ++++ script_type_overview/widget_scripts.md | 109 +++++++++ 191 files changed, 5185 insertions(+) create mode 100644 advanced_topics/README.md create mode 100644 advanced_topics/debugging_techniques.md create mode 100644 advanced_topics/lua_data_sharing_across_scripts.md create mode 100644 advanced_topics/optimization_tricks.md create mode 100644 lua_api_programming_guide/README.md create mode 100644 lua_api_programming_guide/data-exchange-with-the-edgetx-model-setup.md create mode 100644 lua_api_programming_guide/drawing-flags-and-colors.md create mode 100644 lua_api_programming_guide/included_lua_libraries/README.md create mode 100644 lua_api_programming_guide/included_lua_libraries/bit32.library.md create mode 100644 lua_api_programming_guide/included_lua_libraries/io-library/README.md create mode 100644 lua_api_programming_guide/included_lua_libraries/io-library/io.close.md create mode 100644 lua_api_programming_guide/included_lua_libraries/io-library/io.open.md create mode 100644 lua_api_programming_guide/included_lua_libraries/io-library/io.read.md create mode 100644 lua_api_programming_guide/included_lua_libraries/io-library/io.seek.md create mode 100644 lua_api_programming_guide/included_lua_libraries/io-library/io.write.md create mode 100644 lua_api_programming_guide/included_lua_libraries/math.library.md create mode 100644 lua_api_programming_guide/included_lua_libraries/string.library.md create mode 100644 lua_api_programming_guide/init_function_syntax.md create mode 100644 lua_api_programming_guide/input_table_syntax.md create mode 100644 lua_api_programming_guide/loading-code-modules-dynamically.md create mode 100644 lua_api_programming_guide/lua-basics.md create mode 100644 lua_api_programming_guide/output_table_syntax.md create mode 100644 lua_api_programming_guide/return_statement_syntax.md create mode 100644 lua_api_programming_guide/run_function_syntax.md create mode 100644 lua_api_programming_guide/saving-memory.md create mode 100644 lua_api_programming_guide/using-key-and-touch-events.md create mode 100644 lua_api_reference/README.md create mode 100644 lua_api_reference/bitmap/README.md create mode 100644 lua_api_reference/bitmap/bitmap.resize-bitmap-width-height.md create mode 100644 lua_api_reference/bitmap/bitmap.tomask-bitmap.md create mode 100644 lua_api_reference/bitmap/getsize.md create mode 100644 lua_api_reference/bitmap/open.md create mode 100644 lua_api_reference/constants/README.md create mode 100644 lua_api_reference/constants/color-constants.md create mode 100644 lua_api_reference/constants/flags-and-pattern-constants.md create mode 100644 lua_api_reference/constants/key_events.md create mode 100644 lua_api_reference/constants/logical-switch-function-constants.md create mode 100644 lua_api_reference/constants/screen-constants.md create mode 100644 lua_api_reference/constants/special-character-constants.md create mode 100644 lua_api_reference/constants/special-function-constants.md create mode 100644 lua_api_reference/constants/touch-event-constants.md create mode 100644 lua_api_reference/constants/widget-options.md create mode 100644 lua_api_reference/filesystem/README.md create mode 100644 lua_api_reference/filesystem/del-file-or-directory.md create mode 100644 lua_api_reference/filesystem/dir-directory.md create mode 100644 lua_api_reference/filesystem/fstat-path.md create mode 100644 lua_api_reference/general/README.md create mode 100644 lua_api_reference/general/accesstelemetrypush.md create mode 100644 lua_api_reference/general/chdir.md create mode 100644 lua_api_reference/general/crossfiretelemetrypop.md create mode 100644 lua_api_reference/general/crossfiretelemetrypush.md create mode 100644 lua_api_reference/general/defaultchannel.md create mode 100644 lua_api_reference/general/defaultstick.md create mode 100644 lua_api_reference/general/flushaudio.md create mode 100644 lua_api_reference/general/getavailablememory.md create mode 100644 lua_api_reference/general/getdatetime.md create mode 100644 lua_api_reference/general/getfieldinfo.md create mode 100644 lua_api_reference/general/getflightmode.md create mode 100644 lua_api_reference/general/getgeneralsettings.md create mode 100644 lua_api_reference/general/getglobaltimer.md create mode 100644 lua_api_reference/general/getlogicalswitchvalue-id.md create mode 100644 lua_api_reference/general/getoutputvalue-outputindex.md create mode 100644 lua_api_reference/general/getras.md create mode 100644 lua_api_reference/general/getrotencmode.md create mode 100644 lua_api_reference/general/getrotencspeed.md create mode 100644 lua_api_reference/general/getrssi.md create mode 100644 lua_api_reference/general/getrtctime.md create mode 100644 lua_api_reference/general/getshmvar-id.md create mode 100644 lua_api_reference/general/getsourceindex-sourcename.md create mode 100644 lua_api_reference/general/getsourcename-sourceindex.md create mode 100644 lua_api_reference/general/getsourcevalue-source.md create mode 100644 lua_api_reference/general/getswitchindex-positionname.md create mode 100644 lua_api_reference/general/getswitchname-switchindex.md create mode 100644 lua_api_reference/general/getswitchvalue-switchindex.md create mode 100644 lua_api_reference/general/gettime.md create mode 100644 lua_api_reference/general/gettxgps.md create mode 100644 lua_api_reference/general/getusage.md create mode 100644 lua_api_reference/general/getvalue.md create mode 100644 lua_api_reference/general/getversion.md create mode 100644 lua_api_reference/general/ghosttelemetrypop.md create mode 100644 lua_api_reference/general/ghosttelemetrypush.md create mode 100644 lua_api_reference/general/grey.md create mode 100644 lua_api_reference/general/killevents.md create mode 100644 lua_api_reference/general/loadscript.md create mode 100644 lua_api_reference/general/multibuffer.md create mode 100644 lua_api_reference/general/playduration.md create mode 100644 lua_api_reference/general/playfile.md create mode 100644 lua_api_reference/general/playhaptic.md create mode 100644 lua_api_reference/general/playnumber.md create mode 100644 lua_api_reference/general/playtone.md create mode 100644 lua_api_reference/general/popupconfirmation-title-message-event.md create mode 100644 lua_api_reference/general/popupconfirmation.md create mode 100644 lua_api_reference/general/popupinput.md create mode 100644 lua_api_reference/general/popupwarning.md create mode 100644 lua_api_reference/general/resetglobaltimer.md create mode 100644 lua_api_reference/general/serialgetpower-port_nr.md create mode 100644 lua_api_reference/general/serialread.md create mode 100644 lua_api_reference/general/serialsetpower-port_nr-value.md create mode 100644 lua_api_reference/general/serialwrite.md create mode 100644 lua_api_reference/general/setserialbaudrate-baudrate.md create mode 100644 lua_api_reference/general/setserialbaudrate.md create mode 100644 lua_api_reference/general/setshmvar-id-value.md create mode 100644 lua_api_reference/general/setstickyswitch-id-value.md create mode 100644 lua_api_reference/general/settelemetryvalue.md create mode 100644 lua_api_reference/general/sources-first-last.md create mode 100644 lua_api_reference/general/sporttelemetrypop.md create mode 100644 lua_api_reference/general/sporttelemetrypush.md create mode 100644 lua_api_reference/general/switches-first-last.md create mode 100644 lua_api_reference/lcd/README.md create mode 100644 lua_api_reference/lcd/RGB.md create mode 100644 lua_api_reference/lcd/clear.md create mode 100644 lua_api_reference/lcd/drawBitmap.md create mode 100644 lua_api_reference/lcd/drawChannel.md create mode 100644 lua_api_reference/lcd/drawCombobox.md create mode 100644 lua_api_reference/lcd/drawFilledRectangle.md create mode 100644 lua_api_reference/lcd/drawGauge.md create mode 100644 lua_api_reference/lcd/drawLine.md create mode 100644 lua_api_reference/lcd/drawNumber.md create mode 100644 lua_api_reference/lcd/drawPixmap.md create mode 100644 lua_api_reference/lcd/drawPoint.md create mode 100644 lua_api_reference/lcd/drawRectangle.md create mode 100644 lua_api_reference/lcd/drawScreenTitle.md create mode 100644 lua_api_reference/lcd/drawSource.md create mode 100644 lua_api_reference/lcd/drawSwitch.md create mode 100644 lua_api_reference/lcd/drawText.md create mode 100644 lua_api_reference/lcd/drawTimer.md create mode 100644 lua_api_reference/lcd/drawannulus.md create mode 100644 lua_api_reference/lcd/drawarc.md create mode 100644 lua_api_reference/lcd/drawcircle.md create mode 100644 lua_api_reference/lcd/drawfilledcircle.md create mode 100644 lua_api_reference/lcd/drawfilledtriangle.md create mode 100644 lua_api_reference/lcd/drawhudrectangle.md create mode 100644 lua_api_reference/lcd/drawlinewithclipping.md create mode 100644 lua_api_reference/lcd/drawpie.md create mode 100644 lua_api_reference/lcd/drawtriangle.md create mode 100644 lua_api_reference/lcd/getColor.md create mode 100644 lua_api_reference/lcd/getLastLeftPos.md create mode 100644 lua_api_reference/lcd/getLastPos.md create mode 100644 lua_api_reference/lcd/getLastRightPos.md create mode 100644 lua_api_reference/lcd/lcd.drawbitmappattern-bitmap-x-y-flags.md create mode 100644 lua_api_reference/lcd/lcd.drawbitmappatternpie-bitmap-x-y-startangle-endangle-flags.md create mode 100644 lua_api_reference/lcd/lcd.drawtextlines-x-y-w-h-text-flags.md create mode 100644 lua_api_reference/lcd/lcd.exitfullscreen.md create mode 100644 lua_api_reference/lcd/lcd.invertrect-x-y-w-h-flags.md create mode 100644 lua_api_reference/lcd/lcd_functions-overview.md create mode 100644 lua_api_reference/lcd/refresh.md create mode 100644 lua_api_reference/lcd/resetBacklightTimeout.md create mode 100644 lua_api_reference/lcd/setColor.md create mode 100644 lua_api_reference/lcd/sizetext.md create mode 100644 lua_api_reference/model/README.md create mode 100644 lua_api_reference/model/defaultinputs.md create mode 100644 lua_api_reference/model/deleteflightmodes.md create mode 100644 lua_api_reference/model/deleteinput.md create mode 100644 lua_api_reference/model/deleteinputs.md create mode 100644 lua_api_reference/model/deletemix.md create mode 100644 lua_api_reference/model/deletemixes.md create mode 100644 lua_api_reference/model/getcurve.md create mode 100644 lua_api_reference/model/getcustomfunction.md create mode 100644 lua_api_reference/model/getflightmode.md create mode 100644 lua_api_reference/model/getglobalvariable.md create mode 100644 lua_api_reference/model/getinfo.md create mode 100644 lua_api_reference/model/getinput.md create mode 100644 lua_api_reference/model/getinputscount.md create mode 100644 lua_api_reference/model/getlogicalswitch.md create mode 100644 lua_api_reference/model/getmix.md create mode 100644 lua_api_reference/model/getmixescount.md create mode 100644 lua_api_reference/model/getmodule.md create mode 100644 lua_api_reference/model/getoutput.md create mode 100644 lua_api_reference/model/getsensor.md create mode 100644 lua_api_reference/model/gettimer.md create mode 100644 lua_api_reference/model/insertinput.md create mode 100644 lua_api_reference/model/insertmix.md create mode 100644 lua_api_reference/model/model.getswashring.md create mode 100644 lua_api_reference/model/model.setswashring-params.md create mode 100644 lua_api_reference/model/resetsensor.md create mode 100644 lua_api_reference/model/resettimer.md create mode 100644 lua_api_reference/model/setcurve.md create mode 100644 lua_api_reference/model/setcustomfunction.md create mode 100644 lua_api_reference/model/setflightmode.md create mode 100644 lua_api_reference/model/setglobalvariable.md create mode 100644 lua_api_reference/model/setinfo.md create mode 100644 lua_api_reference/model/setlogicalswitch.md create mode 100644 lua_api_reference/model/setmodule.md create mode 100644 lua_api_reference/model/setoutput.md create mode 100644 lua_api_reference/model/settimer.md create mode 100644 script_type_overview/README.md create mode 100644 script_type_overview/function_scripts.md create mode 100644 script_type_overview/mix.md create mode 100644 script_type_overview/one-time_scripts.md create mode 100644 script_type_overview/telemetry.md create mode 100644 script_type_overview/widget_scripts.md diff --git a/advanced_topics/README.md b/advanced_topics/README.md new file mode 100644 index 000000000..d5127e1d0 --- /dev/null +++ b/advanced_topics/README.md @@ -0,0 +1,4 @@ +# Part VI - Advanced Topics + +The advanced topics section covers file I/O, data sharing, and debugging techniques + diff --git a/advanced_topics/debugging_techniques.md b/advanced_topics/debugging_techniques.md new file mode 100644 index 000000000..fa24be67a --- /dev/null +++ b/advanced_topics/debugging_techniques.md @@ -0,0 +1,100 @@ +# Debugging techniques + +## Debugging your code before testing + +### A good editor is key + +It is always good practice to check your code on syntax before even testing it. There are several good LUA editors on the market, some of them for free. The ZeroBrane \([https://studio.zerobrane.com/](https://studio.zerobrane.com/)\) suite is quite powerful, and very simple to use. In the rest of this article we will assume you use ZeroBrane, but the same techniques can be used in any powerful code editor. + +You can set ZeroBrane to use the Scripts directory of your simulated transmitter SDCard image as a default directory, and it will show you all the files in a nice navigation tree. + +If you open a LUA file, you will already have some markup in your screen, indicating errors or important info. In ZeroBrane for instance, a not declared variable will always get underlined, so that you are made aware you forgot to declare it, or you redeclared it by accident afterwards again. + +### Checking if the code can be compiled + +The editor will have an "execute code" option, that will try to run the code on it's own interpreter \(code processing engine\). If there are any syntax errors, it will not be able to execute the code, and inform you about the errors. A common error in LUA is using a single equal sign \(=\) in a condition in an 'if' statement, whereas in LUA that should be a double equal sign \(==\). The interpreter will inform you about such an error ocurring, and mention the line where you made the error. + +Since the OpenTX LUA environment has some own functions, like lcd.drawText\(\), the interpreter will 'complain' it cannot call an unspecified function, but it will check the entire syntax nonetheless. + +### Ready to run the code + +In zerobrane, if you tried to run the code, it will first save it if it could be interpreted correctly. A common workflow would be: + +* do some code corrections / additions +* try to run the code in the editor +* if the code gets compiled, the edited LUA file gets saved automatically +* run the code in the transmitter simulator +* check for the desired functionality +* restart this cycle + +## The lua debug viewer + +In the later versions of the companion software, a LUA debug screen is available. So once you start your just syntaxically verified and saved LUA script, you can follow some of it's output and actions in the debug screen. It will tell you where and in what line an eventual crash occured. + +## Using a script loader + +If you made some code changes, chances are that you have to do a whole sequence of key-clicks and actions on the transmitter simulator in order to retest the same script after those changes. + +You can substatially reduce the effort of all this by using a script loader in your transmitter. This is nothing more then a function that will load and run your code. If you press the enter button, it will unload the current code, and ask if you want to run the code again. So, with just two clicks, you can unload the running code and reload your updated code. On the Taranis simulator, you can also reload the LUA scripts environment with just a buttonclick. + +An example of such a script is found under the notes. You can adapt it for other types of scripts of course. + +## Notes + +### Script Loader + +This script loader will load the file /SCRIPTS/TELEM/telem1.lua, run it, and wait for an Enter Break event. Once received, it will unload the code and wait for a next Enter Break event. + +```lua +local fileToLoad="/SCRIPTS/TELEM/telem1.lua" +local active = true +  +local thisPage={} +local page={} +  +local function clearTable(t) + if type(t)=="table" then + for i,v in pairs(t) do + if type(v) == "table" then + clearTable(v) + end + t[i] = nil + end + end + collectgarbage() + return t +end + +thisPage.init=function(...) + if active then + page=dofile(fileToLoad) + page.init(...) + end + return true +end +  +thisPage.background=function(...) + if active then + page.background(...) + end + return true +end +  +thisPage.run=function(...) + if active then + page.run(...) + active= not (...==EVT_ENTER_BREAK) + else + lcd.drawText( 15, 2, fileToLoad, 0 ) + lcd.drawText( 15, 20, "disabled", 0 ) + lcd.drawText( 15, 40,"press enter-button to activate",0) + clearTable(page) + active= (...==EVT_ENTER_BREAK) + thisPage.init() + end + return not (...==EVT_MENU_BREAK) +end +  +return thisPage +``` + diff --git a/advanced_topics/lua_data_sharing_across_scripts.md b/advanced_topics/lua_data_sharing_across_scripts.md new file mode 100644 index 000000000..9ee0c48c2 --- /dev/null +++ b/advanced_topics/lua_data_sharing_across_scripts.md @@ -0,0 +1,186 @@ +# Lua data sharing across scripts + +## Overview: + +OpenTX considers all function, mix, and telemetry scripts to be 'permanent' scripts that share the same runtime environment. They are typically loaded at power up or when a new model is selected. However, they are also reinitialized when a script is added or removed during model editing. + +## Lua scoping rules: + +Any variable or function not declared local is implicitly global. Care must be taken to avoid unintentional global declarations, and ensure that the globals you intentionally declare have unique names to avoid conflicts with scripts written by others. + +## Example: + +This example consists of three scripts + +* **count-dn.lua** - this is a mix script than can be run stand alone to announce time remaining based on a user-defined switch and duration. It updates two global variables \(gCountUp and gCountDown\). It also creates output values \(ctup and ctdn\) which are for demonstration purposes only. +* **count-up.lua** - this is an optional function script which will do count up announcements based on harded coded values. +* **shocount.lua** - this is an optional telemetry script which simply shows the current values of the gCountUp and gCountDown variables. + +## Installation: + +* count-dn.lua + * copy to /SCRIPTS/MIXES + * configure on the transmitter CUSTOM SCRIPT page + * suggested switch = "SA" + * suggested mins = 3 + * suggested sw\_high = 0 + * screen image: + + ![count-dn.lua mix script](https://github.com/opentx/opentx-2-3-lua-reference-guide/tree/0d355d19f1961b689994cf78b84005864d33f9b5/count-dn.png) +* count-up.lua + * copy to /SCRIPTS/FUNCTIONS + * configure on the transmitter SPECIAL FUNCTIONS page + * suggested switch SA\(down\) + * screen image: + + ![count-up.lua function script](https://github.com/opentx/opentx-2-3-lua-reference-guide/tree/0d355d19f1961b689994cf78b84005864d33f9b5/count-up.png) +* shocount.lua + * copy to /SCRIPTS/TELEMETRY + * configure on the transmitter TELEMETRY page + * screen image: + + ![shocount.lua function script](https://github.com/opentx/opentx-2-3-lua-reference-guide/tree/0d355d19f1961b689994cf78b84005864d33f9b5/shocount.png) + +## Script sources: + +### count-dn.lua + +```lua +-- these globals can be referenced in function and telemetry scripts +gCountUp = 0 +gCountDown = 0 + +local target +local running = false +local complete = false +local announcements = { 720, 660, 600, 540, 480, 420, 360, 300, 240, 180, 120, 105, 90, 75, 60, 55, 50, 45, 40, 35, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0} +local annIndex -- index into the announcements table (1 based) +local minUnit -- used by playNumber() for unit announcement + +local input = + { + { "switch", SOURCE}, -- switch used to activate count down + { "mins", VALUE, 1, 12, 2 }, -- minutes to count down + { "sw_high", VALUE, 0, 1, 1 } -- 0 = active when low, otherwise active when high + } + +local output = {"ctup", "ctdn" } + +local function init() + local version = getVersion() + if version < "2.1" then + minUnit = 16 -- unit for minutes in OpenTX 2.0 + elseif version < "2.2" then + minUnit = 23 -- unit for minutes in OpenTX 2.1 + else + minUnit = 25 -- unit for minutes in OpenTX 2.2 + end +end + +local function countdownIsRunning(switch, sw_high) + -- evaluate switch - return true if we should be counting down + if (sw_high > 0) then + return (switch > -1000) + else + return (switch < 1000) + end +end + +local function run(switch, mins, sw_high) + local timenow = getTime() -- 10ms tick count + local minutes + local seconds + + if (not countdownIsRunning(switch, sw_high)) then + running = false + complete = false + return 0, 0 -- ***** NOTE: early exit ***** + end + + if (complete) then + return 0, 0 -- must reset the switch before we go again + end + + if (not running) then + running = true + target = timenow + ((mins * 60) * 100) + annIndex = 1 + end + + gCountDown = math.floor(((target - timenow) / 100) + .7) -- + is adj. to for announcement lag + gCountUp = (mins * 60) - gCountDown + + while gCountDown < announcements[annIndex] do + annIndex = annIndex + 1 -- catch up + end + + if gCountDown == announcements[annIndex] then + minutes = math.floor(gCountDown / 60) + seconds = gCountDown % 60 + if minutes > 0 then + playNumber(minutes, minUnit, 0) + end + if seconds > 0 then + playNumber(seconds, 0, 0) + end + annIndex = annIndex + 1 + end + + if gCountDown <= 0 then + playNumber(0,0,0) + running = false + gCountDown = 0 + complete = true + end + + return gCountUp * 10.24, gCountDown * 10.24 +end + +return { input=input, output=output, init=init, run=run } +``` + +### count-up.lua + +```lua +gCountUp = 0 + +local min = 5 +local max = 30 +local last = 0 +local announcements = { 5, 10, 15, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 } +local annIndex = 1 + +local function run(e) + if not (gCountUp == last) then + last = gCountUp + for key, value in pairs(announcements) do + if value == last then + playNumber(last, 0, 0) + end + end + end +end + +return{run=run} +``` + +### shocount.lua + +```lua +-- these globals can be referenced in mix, function, and telemetry scripts +gCountUp = 0 +gCountDown = 0 + +local function run(e) + lcd.clear() + lcd.drawText(1,1,"OpenTx Lua Data Sharing",0) + + lcd.drawText(1,11,"gCountUp:", 0) + lcd.drawText(lcd.getLastPos()+2,11,gCountUp,0) + lcd.drawText(1, 21, "gCountDown:", 0) + lcd.drawText(lcd.getLastPos()+2,21,gCountDown,0) +end + +return{run=run} +``` + diff --git a/advanced_topics/optimization_tricks.md b/advanced_topics/optimization_tricks.md new file mode 100644 index 000000000..8c4508c9b --- /dev/null +++ b/advanced_topics/optimization_tricks.md @@ -0,0 +1,27 @@ +# Speed/memory optimizaton tricks + +## Faster getValue() + +Normally one uses [getValue()](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getvalue.md) function with the source/filed name like so: + +```lua +local foo = getValue("bar") +``` + +This works and is recommended method for portability. But if a particular script needs to get the value of certain field a lot, then it is faster to use this syntax: + +```lua +local my_id = getFieldInfo("bar").id -- here we get the numerical id of the filed "bar" + +local function run_a_lot() + local my_value = getValue(my_id) -- exactly the same effect as local my_value = getValue("bar"), but faster +end +``` + +Why is this method faster? With the function [getFieldInfo(name)](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getfieldinfo.md) we get the `numerical id` of the wanted filed. The function has to find the requested value by its name in the table of all available sources. That search takes some time. + +When we use this syntax the search is only done once. In comparison in the first example the search must be performed every time `getValue("bar")` is called. + +So when the `getValue(my_id)` is called the search can be skipped and the requested value if fetched directly. + +Of course there is a trade-of, the second example uses little more memory (for variable `my_id`). diff --git a/lua_api_programming_guide/README.md b/lua_api_programming_guide/README.md new file mode 100644 index 000000000..fe02f20eb --- /dev/null +++ b/lua_api_programming_guide/README.md @@ -0,0 +1,4 @@ +# Part II - EdgeTX Lua API Programming Guide + +This section provides more specifics on the EdgeTX Lua implementation. Here you will find syntax rules for interface tables and functions. + diff --git a/lua_api_programming_guide/data-exchange-with-the-edgetx-model-setup.md b/lua_api_programming_guide/data-exchange-with-the-edgetx-model-setup.md new file mode 100644 index 000000000..115221d60 --- /dev/null +++ b/lua_api_programming_guide/data-exchange-with-the-edgetx-model-setup.md @@ -0,0 +1,103 @@ +--- +description: >- + An EdgeTX model has several data components that can be exchanged with Lua + scripts. This section gives an overview. +--- + +# Data Exchange with the EdgeTX Model Setup + +In general terms, there are two different types of data that can be exchanged with EdgeTX: + +* Values, which generally fall on a scale between -1024 and 1024, also sometimes reported as -100% to 100%, e.g. for mixer values and channel outputs. +* Switches, which are either `true` or `false.` + +A specific data source type, e.g. Global Variables, can be indexed directly with an index that starts with 0 for the first one. This can be a little confusing, as e.g. GV1 for FM0 is read with [`model.getGlobalVariable(0, 0)`](../part\_iii\_-\_opentx\_lua\_api\_reference/model-functions-less-than-greater-than-luadoc-begin-model/getglobalvariable.md), because GV1 is the first global variable, and FM0 is the first flight mode. But as long as you remember that all direct indices start with 0 for the first one, you should be fine! + +Global Variables is a _value_ data source that can return a value between -1024 and 1024. Examples of value sources are: + +* Global Variables +* Sticks, sliders and knobs +* Trim values +* Input lines +* Channel outputs +* Trainer channel inputs +* Telemetry sensors + +There is a way to access a value of _any_ such type with a _meta-index_. You use the function [`getFieldInfo(name)`](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getfieldinfo.md) where `name` can be any of the valid source names listed [here](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getfieldinfo.md). It returns a table with a description of the value source, including the field `id,` which is the meta-index. + +You can use `id` with the function [`getValue(id)`](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getvalue.md) to read the current value. You can also use `name` directly, but this is less efficient, as EdgeTX does a linear search for the name every time it is called. Therefore, the procedure of first extracting the meta-index from `getFieldInfo(name).id`, and then using that, is recommended. + +For switches, [`getLogicalSwitchValue(index)`](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getlogicalswitchvalue-id.md) uses a direct index to read this specific type of switch sources, again using the `index` 0 for LS1 etc. But there are also several types of switch sources, such as: + +* Logical switches +* Switch positions, testing if a physical switch is in a particular position, e.g. `SA↑`. +* Trim buttons +* Transmitter and telemetry activity + +You can find the meta-index of a particular switch source with [`getSwitchIndex(name)`](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchindex-positionname.md), where `name` is exactly the name that you see in the radio menus where you can select a switch source. + +You can read the current value of a switch source with [`getSwitchValue(index)`](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchvalue-switchindex.md) as a `true`/`false` value. + +It can be very confusing that some source can be read both as a value and as a switch. As an example, elevator trim can be read as the current value of the _trim_: + +```lua +local id = getFieldInfo("trim-ele") +local eleTrim = getValue(id) +``` + +Or it can be read as the current value of the _trim button position_: + +```lua +local idUp = getSwitchIndex(CHAR_TRIM .. "Eu") +local idDown = getSwitchIndex(CHAR_TRIM .. "Ed") +local eleUp = getSwitchValue(idUp) +local eleDown = getSwitchValue(idDown) +``` + +These are really two different things, as the elevator _trim_ is an internal value stored by the radio, which is changed with the trim button, and the button is a physical button. + +But it can also be a more direct comparison, e.g. the 3-position switch B, which can be read as a _value_ source with: + +```lua +local idB = getFieldInfo("sb") +local swBvalue = getValue(idB) -- a value of -1024, 0 or 1024 +``` + +Or the current position of switch B can be read with: + +```lua +local idBup = getSwitchIndex("SB" .. CHAR_UP) +local idBdown = getSwitchIndex("SB" .. CHAR_DOWN) +local swBup = getSwitchValue(idBup) +local swBdown = getSwitchValue(idBdown) +``` + +Hopefully, these examples illustrated the differences between _values_ and _switches_, and showed how these can be retrieved in a Lua script. + +You can also send data the other way: from Lua to the EdgeTX model setup. + +To send a _value_, use a global variable: `model.setGlobalVariable(index, fm, value)`. If you use the default GV setting, where all other flight modes use the value of FM0, then you can use 0 for `fm`. + +To send a _switch_, setup a `STICKY` type logical switch, and then use `setStickySwitch(index, true/false)`. + +The following table gives an overview of the Lua API functions that can be used to exchange data with the EdgeTX model setup. + +| Function | Description | +| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `getFieldInfo(name)` | Gets the meta-index of a _value_ source with `name`. | +| `getValue(index)` | Gets the current value of a source, where `index` is from the above. | +| `getFlightMode()` | Returns the current flight mode number and name. **Do not** confuse with `model.getFlightMode`, which is a completely different function! | +| `model.getGlobalVariable( index, fm)` | Read the value of a global variable between -1024 and 1024. You can use the above to get the current flioght mode for `fm`, or you can setup the GV to always use the value from FM0. | +| `model.setGlobalVariable( index, fm, value)` | Sets the value of a global variable. | +| `setTelemetryValue(id, subID, instance, value, ...)` | This function can send data from Lua to a telemetry sensor. If it is running, then the sensor will show up with Discover Sensors. This can be used to log values generated by Lua. | +| `getLogicalSwitchValue( index)` | Get the value of a logical switch. | +| `setStickySwitch(id, value)` | Set the value of a `STICKY` type logical switch. | +| `getSwitchIndex(name)` | Get the meta-index of a switch source with `name`. | +| `getSwitchName(index)` | Get the name of a switch source. | +| `getSwitchValue(index)` | Get the value of a switch source. | +| `getPhysicalSwitches()` | Get a list of physical switches on the radio. Can be used to make a selection list. | +| `getShmVar(index)` | Get the value of a shared memory variable. These are little "mail boxes" provided as a way to send data between Lua widgets and other Lua scripts like Mixer and Function scripts. | +| `setShmVar(index, value)` | Set the value of a shared memory variable. | +| `model.setTimer(timer, value)` | Set the timer to `value`. | +| `model.getTimer(timer)` | Read the timer. | + diff --git a/lua_api_programming_guide/drawing-flags-and-colors.md b/lua_api_programming_guide/drawing-flags-and-colors.md new file mode 100644 index 000000000..c8efe20db --- /dev/null +++ b/lua_api_programming_guide/drawing-flags-and-colors.md @@ -0,0 +1,53 @@ +--- +description: This section will give some technical details for radios with a color screen. +--- + +# Drawing Flags and Colors + +An argument with drawing flags can be given to the various functions that draw on the LCD screen. The lower half of the flags \(bits 1-16\) are the flag attributes shown below, and the upper half of the flags \(bits 17-32\) are a color value. + +Not all of the flags below should be directly manipulated from Lua, but those that are meant to be set directly by Lua, are accessible by the [Lua flag constants](../part_iii_-_opentx_lua_api_reference/constants/flags-and-pattern-constants.md#flags). + +![](../.gitbook/assets/flags%20%281%29.png) + +Since the flags are bits, you can add them up to combine, as long as you only add each flag _one_ time. If you add the same flag twice, then it will add up to the next bit over, e.g. `INVERS + INVERS = VCENTER`. If you want to add a flag to a value where it may already be set, then use `flags = bit32.bor(flags, INVERS)`. + +RGB\_FLAG decides how the color value is encoded into the upper half \(bits 17-32\). + +If RGB\_FLAG = 0, then an index into a color table is stored. This color table holds a default color \(index 0\), the theme colors, and CUSTOM\_COLOR. The entries in the color table can be changed with the function [`lcd.setColor`](../part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/setcolor.md). The advantage of this system is that the color changes everywhere that this indexed color is used, and this is how different color themes are created. **Notice that changing the theme colors affects the entire user interface of your radio!!** + +If RGB\_FLAG = 1, then a 16-bit RGB565 color is stored. This is used directly by the system to draw a color on the screen. + +You should not change RGB\_FLAG explicitly; this is handled automatically by the various functions and Lua constants. But you should be aware of the following. + +* [`lcd.setColor`](../part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/setcolor.md) must have an [indexed color](../part_iii_-_opentx_lua_api_reference/constants/color-constants.md#indexed-colors) as its first argument, because this will be the index of the color in the table being changed. Giving another color, e.g. ORANGE, as the first argument will result in nothing. +* If no color is given to the flags with a drawing function, RGB\_FLAGS = 0 and the color index = 0. Therefore, the default color is stored in the color table under this index, and you can change the default color with `lcd.setColor(0, color)`. +* [`lcd.getColor` ](../part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getcolor.md)always returns a RGB color. This can be used to "save" an indexed color before you change it. +* [`lcd.RGB`](../part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/rgb.md) obviously returns a RGB color. + +### Colors in EdgeTX versus OpenTX + +OpenTX only supports indexed colors in drawing functions, so you must first call `lcd.setColor` to change e.g. CUSTOM\_COLOR, and then call the LCD drawing function with that indexed color. In EdgeTX, you can use either type of color for drawing functions, so you are no longer forced to constantly call `lcd.setColor`. You can also store any color in local variables, and then use these when drawing, thus effectively creating your own color theme. + +In OpenTX, `lcd.RGB` returns a 16 bit RGB565 value, but in EdgeTX it returns a 32 bit flags value with the 16 bit RGB565 value in the upper half \(bits 17-32\). Therefore, colors in EdgeTX are not binary compatible with colors in OpenTX. But if you use the functions `lcd.RGB`, `lcd.setColor`, and `lcd.getColor`, then your code should work the same way in EdgeTX as in OpenTX. + +Unfortunately, OpenTX has disabled the function `lcd.RGB` when the screen is not available for drawing, so it can only be called successfully from the `refresh` function in widgets and from the `run` function in One-Time scripts. Therefore, some existing widget scripts set up colors with hard coded constants instead of calling `lcd.RGB` during initialization, and this is not going to work with EdgeTX, because of the different binary format. + +A pull request has been submitted to OpenTX, allowing `lcd.RGB` to work also during widget script initialization, and hopefully, it will be merged into OpenTX 2.3.15. If that happens, then the obvious way to solve the problem is to use `lcd.RGB` values instead of hard coded color constants. But in the meantime, the following RGB function can be used for setting up colors in a way that works for both EdgeTX and OpenTX. + +```lua +local function RGB(r, g, b) + local rgb = lcd.RGB(r, g, b) + + if not rgb then + rgb = bit32.lshift(bit32.rshift(bit32.band(r, 0xFF), 3), 11) + rgb = rgb + bit32.lshift(bit32.rshift(bit32.band(g, 0xFF), 2), 5) + rgb = rgb + bit32.rshift(bit32.band(b, 0xFF), 3) + end + + return rgb +end +``` + +This functions calls `lcd.RGB`, and if it gets a nil value \(because we are running a widget script under OpenTX, and it is not called from the `refresh` function\) then it creates the 16-bit RGB565 value that OpenTX wants. + diff --git a/lua_api_programming_guide/included_lua_libraries/README.md b/lua_api_programming_guide/included_lua_libraries/README.md new file mode 100644 index 000000000..7e5c59b29 --- /dev/null +++ b/lua_api_programming_guide/included_lua_libraries/README.md @@ -0,0 +1,13 @@ +# Included Lua Libraries + +| Lua Standard Libraries | Included | +| ---------------------- | ------------------------------------------------------- | +| package | - | +| coroutine | - | +| table |

since OpenTX 2.3.8

(color LCD radios only)

| +| [io](io-library/) | since OpenTX 2.1.0 (with limitations) | +| os | - | +| string | since OpenTX 2.1.7 | +| bit32 | since OpenTX 2.1.0 | +| math | since OpenTX 2.0.0 | +| debug | - | diff --git a/lua_api_programming_guide/included_lua_libraries/bit32.library.md b/lua_api_programming_guide/included_lua_libraries/bit32.library.md new file mode 100644 index 000000000..13d4cd5d4 --- /dev/null +++ b/lua_api_programming_guide/included_lua_libraries/bit32.library.md @@ -0,0 +1,4 @@ +# bit32.Library + +TODO + diff --git a/lua_api_programming_guide/included_lua_libraries/io-library/README.md b/lua_api_programming_guide/included_lua_libraries/io-library/README.md new file mode 100644 index 000000000..55dff2d4b --- /dev/null +++ b/lua_api_programming_guide/included_lua_libraries/io-library/README.md @@ -0,0 +1,52 @@ +# io Library + +The **io** library has been simplified and only a subset of functions and their functionality is available. What follows is a complete reference of io functions that are available to EdgeTX scripts + +## Available functions: + +* io.open() +* io.close() +* io.read() +* io.write() +* io.seek() + +## Examples + +### Read the whole file + +```lua +-- this is a stand-alone script + +local function run(event) + print("lua io.read test") -- print() statements are visible in Debug output window + local f = io.open("foo.bar", "r") + while true do + local data = io.read(f, 10) -- read up to 10 characters (newline char also counts!) + if #data == 0 then break end -- we get zero length string back when we reach end of the file + print("data: "..data) + end + io.close(f) + return 1 +end + +return { run=run } +``` + +### Append data to file + +```lua +-- this is a stand-alone script + +local function run(event) + print("lua io.write test") + local f = io.open("foo.bar", "a") -- open file in append mode + io.write(f, "first line\r\nsecond line\r\n") + io.write(f, 4, "\r\n", 35.6778, "\r\n") -- one can write multiple items at the same time + local foo = -4.45 + io.write(f, foo, "\r\n") + io.close(f) + return 1 -- this will end the script execution +end + +return { run=run } +``` diff --git a/lua_api_programming_guide/included_lua_libraries/io-library/io.close.md b/lua_api_programming_guide/included_lua_libraries/io-library/io.close.md new file mode 100644 index 000000000..3198b3218 --- /dev/null +++ b/lua_api_programming_guide/included_lua_libraries/io-library/io.close.md @@ -0,0 +1,11 @@ +# io.close() + +The io.close() function is used to close open file. + +## Parameters + +* `file object` a file object that was returned by the io.open() function. + +## Return value + +* none diff --git a/lua_api_programming_guide/included_lua_libraries/io-library/io.open.md b/lua_api_programming_guide/included_lua_libraries/io-library/io.open.md new file mode 100644 index 000000000..63da604cc --- /dev/null +++ b/lua_api_programming_guide/included_lua_libraries/io-library/io.open.md @@ -0,0 +1,16 @@ +# io.open() + +The io.open() function is used to open the file on SD card for subsequent reading or writing. After the script is done with the file manipulation io.close() function should be used. + +## Parameters + +* `filename` full path to the file starting from the SD card root directory. This function can't create a new file in non-existing directory. +* `mode` supported mode strings are: + * `"r"` read access. File must exist beforehand. The read pointer is located at the beginning of file. This is the default mode if is omitted. + * `"w"` write access. File is opened or created (if it didn't exist) and truncated (all existing file contents are lost). + * "a" write access. File is opened or created (if it didn't exist) and write pointer is located at the end of the file. The existing file contents are preserved. + +## Return value + +* `` if file was successfully opened. +* `nil` if file could not be opened. diff --git a/lua_api_programming_guide/included_lua_libraries/io-library/io.read.md b/lua_api_programming_guide/included_lua_libraries/io-library/io.read.md new file mode 100644 index 000000000..0ed13f47b --- /dev/null +++ b/lua_api_programming_guide/included_lua_libraries/io-library/io.read.md @@ -0,0 +1,15 @@ +# io.read() + +The io.read() function is used to read data from the file on SD card. + +_Notice:_ other read _commands_ (like "_all", etc..) are \*not supported_. + +## Parameters + +* `file object` a file object that was returned by the io.open() function. The file must be opened in read mode. +* `length` number of characters/bytes to read. The number of actual read/returned characters can be less if the file end is reached. + +## Return value + +* `` a string with a length equal or less than +* `""` a zero length string if the end of file was reached diff --git a/lua_api_programming_guide/included_lua_libraries/io-library/io.seek.md b/lua_api_programming_guide/included_lua_libraries/io-library/io.seek.md new file mode 100644 index 000000000..923b68581 --- /dev/null +++ b/lua_api_programming_guide/included_lua_libraries/io-library/io.seek.md @@ -0,0 +1,15 @@ +# io.seek() + +The io.seek() function is used to move the current read/write position. + +_Notice:_ other read standard seek bases (like "cur", "end") are **not supported**. + +## Parameters + +* `file object` a file object that was returned by the io.open() function. +* `offset` position the read/write file pointer at the specified offset from the beginning of the file. If specified offset is bigger than the file size, then the pointer is moved to the end of the file. + +## Return value + +* `0` success +* `` any other value means failure. diff --git a/lua_api_programming_guide/included_lua_libraries/io-library/io.write.md b/lua_api_programming_guide/included_lua_libraries/io-library/io.write.md new file mode 100644 index 000000000..3d1e83012 --- /dev/null +++ b/lua_api_programming_guide/included_lua_libraries/io-library/io.write.md @@ -0,0 +1,13 @@ +# io.write() + +The io.write() function is used to write data to the file on SD card. + +## Parameters + +* `file object` a file object that was returned by the io.open() function. The file must be opened in write or append mode. +* `data` any Lua type that can be converted into string. If more than one data parameter is used their contents are written to the file by one in the same order as they are specified. + +## Return value + +* `` if data was successfully opened. +* `nil, , ` if the data can't be written. diff --git a/lua_api_programming_guide/included_lua_libraries/math.library.md b/lua_api_programming_guide/included_lua_libraries/math.library.md new file mode 100644 index 000000000..006048af4 --- /dev/null +++ b/lua_api_programming_guide/included_lua_libraries/math.library.md @@ -0,0 +1,4 @@ +# math.Library + +TODO + diff --git a/lua_api_programming_guide/included_lua_libraries/string.library.md b/lua_api_programming_guide/included_lua_libraries/string.library.md new file mode 100644 index 000000000..13c9e6b9e --- /dev/null +++ b/lua_api_programming_guide/included_lua_libraries/string.library.md @@ -0,0 +1,4 @@ +# string.Library + +TODO + diff --git a/lua_api_programming_guide/init_function_syntax.md b/lua_api_programming_guide/init_function_syntax.md new file mode 100644 index 000000000..31776c0a8 --- /dev/null +++ b/lua_api_programming_guide/init_function_syntax.md @@ -0,0 +1,18 @@ +# Init Function Syntax + +If defined, _init_ function is called right after the script is loaded from SD card and begins execution. Init is called only once before the run function is called for the first time. + +```lua +local function () + -- code here runs only once when the model is loaded +end +``` + +* **Input Parameters:** + + none + +* **Return values:** + + none + diff --git a/lua_api_programming_guide/input_table_syntax.md b/lua_api_programming_guide/input_table_syntax.md new file mode 100644 index 000000000..794aefa74 --- /dev/null +++ b/lua_api_programming_guide/input_table_syntax.md @@ -0,0 +1,51 @@ +# Input Table Syntax + +## Overview + +The input table defines what values are available as input\(s\) to [mix scripts](../part_i_-_script_type_overview/mix.md). There are two forms of input table entries. + +* **SOURCE syntax** + + ```lua + { "", SOURCE } + ``` + + SOURCE inputs provide the current value of a selected OpenTX variable. The source must set by the user when the mix script is configured. Source can be any value OpenTX knows about \(inputs, channels, telemetry values, switches, custom functions,...\). + _Note:_ typical range is -1024 thru +1024. Simply divide the input value by 10.24 to interpret as a percentage from -100% to +100%. + +* **VALUE syntax** + + ```lua + { "", VALUE, , , } + ``` + + VALUE inputs provide a constant value that is set by the user when the mix script is configured. + + * _name_ - maximum length of 8 characters + * _min_ - minimum value of -128 + * _max_ - maximum value of 127 + * _default_ - must be within the valid range specified + +* **Maximum of 6 inputs per script \(warning : was 8 in 2.1\)** + +## Example using a SOURCE and a VALUE + +```lua +local input = + { + { "Strength", SOURCE}, -- user selects source (typically slider or knob) + { "Interval", VALUE, 0, 100, 0 } -- interval value, default = 0. + } + +local function run(strength, interval) + -- variable strength will contain the current slider value + -- variable interval is set by the user and constant through script lifetime + + -- this script has no return value but may use playFile() to alert user + + return +end + +return {input=input, run=run} +``` + diff --git a/lua_api_programming_guide/loading-code-modules-dynamically.md b/lua_api_programming_guide/loading-code-modules-dynamically.md new file mode 100644 index 000000000..a6807657a --- /dev/null +++ b/lua_api_programming_guide/loading-code-modules-dynamically.md @@ -0,0 +1,37 @@ +--- +description: >- + Lua makes it easy to load and unload code modules on the fly, to save memory + or to provide program extensions. +--- + +# Loading Code Modules Dynamically + +The [`loadScript()`](../part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/loadscript.md) function will load a script from a the file and return a function that is the body of the script, as described in the previous section. So you could have the following Lua script file saved on the SD card: + +```lua +-- /SCRIPTS/TestScript.lua +local c = ... + +local function f(x) + return x + c +end + +return f +``` + +You can load and use the above file with the following code: + +```lua +local chunk = loadScript("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/SCRIPTS/TestScript.lua") + +local f1 = chunk(1) +local y = f1(5) +-- y = 5 + 1 + +local f2 = chunk(3) +local z = f2(5) +-- z = 5 + 3 +``` + +So here we put together what we learned in the previous section. The body of the script is an anonymous function returned by `loadScript` and stored in the variable `chunk`. It returns the function `f` when it is called. The local variable `c` in the script is assigned to the first _vararg_ passed to the call. Since a new closure is created every time we call `chunk`, `f1` and `f2` have different closures with different values of `c`. + diff --git a/lua_api_programming_guide/lua-basics.md b/lua_api_programming_guide/lua-basics.md new file mode 100644 index 000000000..39117d322 --- /dev/null +++ b/lua_api_programming_guide/lua-basics.md @@ -0,0 +1,84 @@ +--- +description: >- + Lua is a small but powerful language. This section will explain a few of the + most important concepts. +--- + +# Lua Basics + +## Introduction + +Lua was chosen for OpenTX, and hence also EdgeTX, because it is a small language designed to be highly extensible by libraries written in C and C++, so it can be integrated into other systems like EdgeTX. It is also relatively efficient, both in terms of memory and CPU usage, and hence well suited for the radios. + +In addition to the provided libraries, Lua has a very elegant mechanism for loading new Lua code modules during run-time. A lot of the elegance comes from the way that the loading mechanism meshes with another concept supported by Lua: first class functions with closures. + +## First Class Functions + +Computer science pioneer Christopher Strachey introduced the concept of functions as _first-class objects_ in his paper [Fundamental Concepts in Programming Languages](https://web.archive.org/web/20100216060948/http://www.cs.cmu.edu/\~crary/819-f09/Strachey67.pdf) from 1967. What it means is that functions can be treated as other variables: as arguments passed in function calls, as results returned from function calls, and a function identifier can be re-assigned to another chunk of function code, just like a variable ca be assigned to a new value. + +In Lua, a function declaration is really "syntactic sugar" for assigning a variable to the chunk of code that is called when the function is invoked, i.e. + +`local function f(x) return x + 1 end` + +is the same as + +`local f = function(x) return x + 1 end` + +You can even add functions to Lua tables, i.e. + +`t = { f = f }` + +will add the above function to the table `t`, as a field that is also called `f`. Does that look familiar to the return statement required at the end of a Lua script? + +Yes indeed, because a script is really an anonymous function that returns a list of functions to the system. The function declarations assign variables to chunks of function code, these variables are added to the list returned at the end of the script, and the system then calls the functions periodically to run the script. So the script itself is run one time initially, and subsequently the functions returned by the last statement are called periodically. + +## Closures + +Another important concept that goes with first-class functions, is _closures_. This is the environment of the function with the variable names that the function can see. Please consider the following function `counter` that returns another function: + +```lua +local function counter(start, step) + local x = start + + return function() + local y = x + x = x + step + return y + end +end +``` + +The function is returned directly without being assigned to a variable name. The _closure_ of the function returned is the body of the function `counter`, containing both the arguments `start` and `step`, and the local variable `x`. So if `c1 = counter(1, 1)` then `c1()` will return 1, 2, 3, ... when called repeatedly, and if `c2 = counter(2, 3)` then `c2()` will return 2, 5, 8, ... + +Likewise, the local variables that you declare outside the functions of your script can be used by all of the functions in your script, and they persist between function calls, but they are not visible to other scripts. + +The [widget scripts](../part\_i\_-\_script\_type\_overview/widget\_scripts.md) are a little trickier, as you can register multiple instances of the same widget script, and all of these instances run within the same Lua closure. Therefore, local variables declared outside any functions in a widget script are shared among all of the instances of that script. But each call to the `create(...)` function returns a new `widget` list to the system. And since this list is unique to each instance, you can add private instance variables to it. + +## Functions with Variable Number of Arguments + +Please consider this function: + +``` +local function match(x, ...) + for i, y in ipairs({...}) do + if x == y then + return true + end + end + return false +end +``` + +It takes an argument `x` and a [vararg](https://www.lua.org/manual/5.2/manual.html#3.4.10) list `...` A vararg list is just like a list of arguments separated by commas, and you can call the function with any number of arguments greater than 1. Inside the function, you can also treat `...` like a comma separated list of variables, e.g. in the above function, `...` is converted to a table by `{...}` just like you could construct a table by e.g. `{a, b, c}`. The table is iterated with the `ipairs` function to look for an element matching the first argument `x`. So e.g. the following statement + +`if event == EVT_VIRTUAL_ENTER or event == EVT_VIRTUAL_EXIT then` + +can be replaced by + +`if match(event, EVT_VIRTUAL_ENTER, EVT_VIRTUAL_EXIT) then` + +You can also use `...` directly as a comma separated list of values, e.g. `local a, b, c = ...` will assign the three variables to the three first arguments following `x`, or `nil` if none are given. + +## References + +The [Lua 5.2 Reference Manual](https://www.lua.org/manual/5.2/manual.html) helpful, both if you want to learn more about Lua, and if you want to search for answers to specific questions. diff --git a/lua_api_programming_guide/output_table_syntax.md b/lua_api_programming_guide/output_table_syntax.md new file mode 100644 index 000000000..bd312b3b3 --- /dev/null +++ b/lua_api_programming_guide/output_table_syntax.md @@ -0,0 +1,35 @@ +# Output Table Syntax + +## Overview + +Outputs are only used in mix scripts. The output table defines only name\(s\), the actual values are determined by the script's [run function](run_function_syntax.md). + +```lua +{ "", "" } +``` + +Example: + +```lua +local output { "Val1", "Val2" } + +local function run() + return 0, -1024 -- these values will be available in OpenTX as Val1 and Val2 +end + +return {output=output, run=run} +``` + +## Notes: + +* Output name is limited to four characters. +* A maximum of 6 outputs are supported +* Number Format Outputs are 16 bit signed integers when they leave Lua script and are then divided by 10.24 to produce output value in percent: + +| Script Return Value | Mix Value in OpenTX | +| :--- | :--- | +| 0 | 0% | +| 996 | 97.2% | +| 1024 | 100% | +| -1024 | -100% | + diff --git a/lua_api_programming_guide/return_statement_syntax.md b/lua_api_programming_guide/return_statement_syntax.md new file mode 100644 index 000000000..5ca4e2b06 --- /dev/null +++ b/lua_api_programming_guide/return_statement_syntax.md @@ -0,0 +1,22 @@ +# Return Statement Syntax + +The return statment is the last statement in an OpenTX Lua script. It defines the input/output table values and functions used to run the script. + +Parameters _init_, _input_ and _output_ are optional. If a script doesn't use them, they can be omitted from return statement. + +Example without _init_ and _output_: + +```lua +local inputs = { { "Aileron", SOURCE }, { "Ail. ratio", VALUE, -100, 100, 0 } } + +local function run_func(ail, ratio) + -- do some stuff + if (ail > 50) and ( ratio < 40) then + playFile("foo.wav") + end +end + +-- script that only uses input and run +return { run=run_func, input=inputs } +``` + diff --git a/lua_api_programming_guide/run_function_syntax.md b/lua_api_programming_guide/run_function_syntax.md new file mode 100644 index 000000000..3e91a1c39 --- /dev/null +++ b/lua_api_programming_guide/run_function_syntax.md @@ -0,0 +1,47 @@ +# Run Function Syntax + +The run function is the function that is periodically called for the lifetime of script execution. Syntax of the run function is different between [mix scripts](../part_i_-_script_type_overview/mix.md) and [telemetry scripts](../part_i_-_script_type_overview/telemetry.md). + +## Run Function for Mix Scripts + +```lua +local function ([first input, [second input], …]) + + -- if mix has no return values + return + + -- if mix has two return values + return value1, value2 + +end +``` + +* **Input parameters:** + + zero or more input values, their names are arbitrary, their meaning and order is defined by the input table. \(see [Input Table Syntax]()\) + +* **Return values:** + * none - if output table is empty \(i.e. script has no output\) + + values + + * or - + + * comma separated list of output values, their order and meaning is defined by the output table. \(see [Output Table Syntax]()\) + +## Run Function for Telemetry Scripts + +```lua +local function (key-event) + return 0 -- values other than zero will halt the script +end +``` + +* **Input parameters:** + + The _key-event_ parameter indicates which transmitter button has been pressed \(see [Key Events](../part_iii_-_opentx_lua_api_reference/constants/key_events.md)\) + +* **Return values:** + + A non-zero return value will halt the script + diff --git a/lua_api_programming_guide/saving-memory.md b/lua_api_programming_guide/saving-memory.md new file mode 100644 index 000000000..15f48003f --- /dev/null +++ b/lua_api_programming_guide/saving-memory.md @@ -0,0 +1,174 @@ +--- +description: >- + This chapter will show you some ways that large script projects can be fitted + into the limited memory of our radios. +--- + +# Saving Memory + +Regarding memory, the situation is a bit different for the radios with black/white or grey scale screens and telemetry scripts, and the radios with color screens and widget scripts. The telemetry script radios only have 128-192 KB RAM memory - that is _very_ small! The widget script radios have 8 MB RAM memory. But the way that widgets are designed means that _all_ widget scripts present on the SD card will be loaded into memory, whether or not they are actually used. Therefore, different strategies should be applied to save memory for the two different types of radios and scripts. + +## Telemetry Script Radios + +Radios with black/white or grey scale screens and telemetry scripts such as e.g. FrSky Taranis, Xlite, Jumper T12 and Radiomaster TX12 have extremely small RAM memories, and therefore it may be necessary to divide up your script into smaller loadable modules. + +The following simple example demonstrates how different screens can be loaded on demand, and how shared data can be stored in a table. + +```lua +-- Main telemetry script + +local shared = { } +shared.screens = { + "/SCRIPTS/Test/menu1.lua", + "/SCRIPTS/Test/menu2.lua", + "/SCRIPTS/Test/menu3.lua" +} + +function shared.changeScreen(delta) + shared.current = shared.current + delta + if shared.current > #shared.screens then + shared.current = 1 + elseif shared.current < 1 then + shared.current = #shared.screens + end + local chunk = loadScript(shared.screens[shared.current]) + chunk(shared) +end + +local function init() + shared.current = 1 + shared.changeScreen(0) +end + +local function run(event) + shared.run(event) +end + +return { run = run, init = init } +``` + +```lua +-- /SCRIPTS/Test/menu1.lua + +local shared = ... + +function shared.run(event) + lcd.clear() + lcd.drawText(20, 10, "Screen 1", MIDSIZE) + + if event == EVT_VIRTUAL_NEXT then + shared.changeScreen(1) + elseif event == EVT_VIRTUAL_PREV then + shared.changeScreen(-1) + end +end +``` + +```lua +-- /SCRIPTS/Test/menu2.lua + +local shared = ... + +function shared.run(event) + lcd.clear() + lcd.drawText(20, 10, "Screen 2", MIDSIZE) + + if event == EVT_VIRTUAL_NEXT then + shared.changeScreen(1) + elseif event == EVT_VIRTUAL_PREV then + shared.changeScreen(-1) + end +end +``` + +```lua +-- /SCRIPTS/Test/menu3.lua + +local shared = ... + +function shared.run(event) + lcd.clear() + lcd.drawText(20, 10, "Screen 3", MIDSIZE) + + if event == EVT_VIRTUAL_NEXT then + shared.changeScreen(1) + elseif event == EVT_VIRTUAL_PREV then + shared.changeScreen(-1) + end +end +``` + +The table `shared` contains data that is shared between the main telemetry script and the loadable screens. Notice that the functions `shared.changeScreen` and `shared.run` are also shared this way. + +Code is loaded by `shared.changeScreen` with the `loadScript` function, which returns the loadable script as a chunk of code. The code is executed with `shared` as the argument, and the loadable script adds a new `run` function to the `shared` table. `shared.run` is called by `run` in the main script. + +## Widget Script Radios + +Radios with color screens and widget scripts such as e.g. FrSky Horus, Jumper T16 and Radiomaster TX16S have fairly large RAM memories, but since all widget scripts present on the SD card are always loaded into memory, they could run out of memory if many big widget scripts are present on the card - even if they are not being used by the selected model. Therefore, large widget scripts should be divided into a small main script and a large loadable part. One way to accomplish this is the following. + +```lua +-- main.lua +local name = "" + +local function create(zone, options) + -- Loadable code is called immediately and returns a widget table + return loadScript("/WIDGETS/" .. name .. "/loadable.lua")(zone, options) +end + +local function refresh(widget, event, touchState) + widget.refresh(event, touchState) +end + +local options = { + -- default options here +} + +local function update(widget, options) + widget.update(options) +end + +local function background(widget) + widget.background() +end + +return { + name = name, + create = create, + refresh = refresh, + options = options, + update = update, + background = background +} +``` + +The `create` function loads the file `loadable.lua` in the folder /WIDGETS/\/, and calls it immediately as described in [the previous section](loading-code-modules-dynamically.md). It passes `zone` and `options` as arguments to `loadable.lua`. This scripts adds the functions `refresh`, `update` and (optionally) `background` to the `widget` table: + +```lua +-- loadable.lua +local zone, options = ... + +-- The widget table will be returned to the main script. +local widget = { } + +function widget.refresh(event, touchState) + -- refresh code here +end + +function widget.update(opt) + options = opt + -- update code here +end + +function widget.background() + -- background code here +end + +-- Return to the create(...) function in the main script +return widget +``` + +`zone` and `options` are stored in the [closure](lua-basics.md#closures) of `loadable.lua`, therefore they do not need to be added to the `widget` table, as is commonly done. + +Obviously, the bulk of the widget's code goes in `loadable.lua`, and is only loaded if the widgets is in fact being used. Therefore, if the widget is not used, only the small amount of code in `main.lua` is loaded into the radio's memory. + +For an example of a widget that uses the above design pattern, please have a look at the **EventDemo** widget that is included on the SD card with EdgeTX for color screen radios. diff --git a/lua_api_programming_guide/using-key-and-touch-events.md b/lua_api_programming_guide/using-key-and-touch-events.md new file mode 100644 index 000000000..a6faa70aa --- /dev/null +++ b/lua_api_programming_guide/using-key-and-touch-events.md @@ -0,0 +1,226 @@ +--- +description: >- + This section will discuss how interactive scripts receiving user inputs via + key and touch events can be created. +--- + +# Using Key and Touch Events + +The two Lua widgets **EventDemo** and **LibGUI** are provided on the SD card content for color screen radios. EventDemo is just a small widget showing off how key, and especially touch events, can be used. LibGUI contains a globally available library, and a widget showing how the library can be used by other widgets. This section will discuss these two widgets for color screen radios, but generally, what is stated about key events here also applies to the `run` function in Telemetry and One-Time scripts. + +## EventDemo Widget + +This widget uses the design pattern for saving memory by loadable files discussed in the [previous section,](saving-memory.md#widget-script-radios) so all of the action takes place in the file **loadable.lua**. The following code listing is an outline of the `refresh` function with comments explaining what is going on. + +```lua +-- This code chunk is loaded on demand by the widget's main script +-- when the create(...) function is run. Hence, the body of this +-- file is executed by the widget's create(...) function. + +-- zone and options were passed as arguments to chunk(...) +local zone, options = ... +-- The widget table will be returned to the main script +local widget = { } + +function widget.refresh(event, touchState) + if event == nil then -- Widget mode + -- Draw in widget mode. The size equals zone.w by zone.h + else -- Full screen mode + -- Draw in full screen mode. The size equals LCD_W by LCD_H + if event ~= 0 then -- Do we have an event? + if touchState then -- Only touch events come with a touchState + if event == EVT_TOUCH_FIRST then + -- When the finger first hits the screen + elseif event == EVT_TOUCH_BREAK then + -- When the finger leaves the screen and did not slide on it + elseif event == EVT_TOUCH_TAP then + -- A short tap gives TAP instead of BREAK + -- touchState.tapCount shows number of taps + elseif event == EVT_TOUCH_SLIDE then + -- Sliding the finger gives a SLIDE instead of BREAK or TAP + if touchState.swipeRight then + -- Is true if user swiped right + elseif touchState.swipeLeft then + elseif touchState.swipeUp then + elseif touchState.swipeDown then + -- etc. + else + -- Sliding but not swiping + end + end + else -- event ~= 0 and touchState == nil: key event + if event == EVT_VIRTUAL_ENTER then + -- User hit ENTER + elseif event == EVT_VIRTUAL_EXIT then + -- etc. + end + end + end + end +end +``` + +## LibGUI + +LibGUI was created to support the SoarETX widgets, but it was made separate so everyone can use it, if they so desire. Since it is all Lua, the code is visible for everyone to study and use as is, or modify for their own use (as long as they comply with the terms of the Gnu Public license, of course). + +It is a widget that comes with a global library. Since all widgets are loaded, whether or not they are being used, global functions declared in the body of a widget script will always be available in any widget script in the `create` and `refresh` functions. It is not necessary to setup the widget to use the library, and the only purpose of the widget is to show how `LibGUI` can be used to create widget apps. + +The library is implemented in the [loadable file](saving-memory.md#widget-script-radios) **/WIDGETS/LibGUI/libgui.lua.** The widget that demonstrates how to use the library is implemented in the [loadable file](saving-memory.md#widget-script-radios) **/WIDGETS/LibGUI/loadable.lua**. The file **/WIDGETS/LibGUI/main.lua** contains the standard functions needed for a widget and handles the loading of the two other files. + +The global function `loadGUI()` returns a new `libGUI` object. This object can be used to create new `GUI`objects, which are used to create screens with elements like buttons, menus, labels, numbers etc. + +### libGUI Properties + +`libGUI` has the following properties controlling general settings for the library. + +#### libGUI.flags + +These are default drawing flags to be applied if no flags are given at creation of screen elements. + +**Note:** these flags should not contain color values, as colors are added by the following. + +#### libGUI.colors + +This is a table of the colors used for drawing the GUI elements. These are all theme colors by default, but they can be changed for the `libGUI` instance without changing the theme colors anywhere else. + +| Color | Default value | Used for | +| -------- | ---------------------- | ---------------------------------------------------------------------------- | +| primary1 | COLOR\_THEME\_PRIMARY1 | Text on dropDown menu | +| primary2 | COLOR\_THEME\_PRIMARY2 | Text on buttons and numbers/timers being edited | +| primary3 | COLOR\_THEME\_PRIMARY3 | Text on labels, menus, and numbers/timers | +| focus | COLOR\_THEME\_FOCUS | Background on buttons and numbers/timers being edited. | +| edit | COLOR\_THEME\_EDIT | Background when a value is being edited. | +| active | COLOR\_THEME\_ACTIVE | Background on active toggle buttons and the border around selected elements. | + +#### libGUI.widgetRefresh + +A function `f()` to draw the zone of the screen in widget mode. It takes no arguments. + +### libGUI Functions + +#### libGUI.match(x, ...) + +This is a small utility function that returns `true` if the first argument `x` matches any of the following arguments. It is useful for comparing values of `event`, e.g. if we want to test if the user pressed either of the following buttons, we can use:`libGUI.match(event, EVT_VIRTUAL_ENTER, EVT_VIRTUAL_EXIT, EVT_VIRTUAL_MENU)` + +#### libGUI.newGUI() + +This is the main function that creates a new `GUI` object. If an application has different screens, then a `GUI` object is created for each screen. + +### GUI Object Properties + +#### GUI.fullScreenRefresh + +A function `f()` to draw the screen background in full screen mode. The GUI elements are drawn afterwards on top. + +### GUI Object Functions + +#### GUI.run(event, touchState) + +Redraws the screen and processes key and touch events. It can directly replace a widget's `refresh` function, or it can be called by `refresh`. + +#### GUI.setEventHandler(event, f) + +Sets a function `f(event, touchState)` to handle an event. If no GUI element is being edited, then this can trap events before they are passed to the GUI, e.g. to press EXIT to go back to the previous screen. If `f` is `nil`, then the event handler is removed. + +If the function returns another event value, then it is passed to the active screen element (i.e. the handler can modify certain events). + +It cannot trap the events `EVT_VIRTUAL_PREV`, `EVT_VIRTUAL_NEXT` as these events are used for navigation. If elements are being edited, then this also takes precedence over the event handler. + +#### GUI.showPrompt(guiPrompt) + +This function can be used to show a modal prompt window, or trap events (alternative to `setEventHandler`). `guiPrompt` is a `GUI` or another Lua table with a function `run(event, touchState`). + +When it is set, the main GUI will first be drawn, and then it will call `guiPrompt.run(event, touchState)` instead of its own `onEvent` function. + +#### GUI.dismissPrompt() + +Dismisses the prompt. + +### GUI Screen Elements + +The screen elements are drawn in the order that they are added to the GUI, and touch events are sent to the first element that covers the touched point of the screen. GUI elements therefore should never overlap. + +There are some common properties that can be set for all or most of the GUI elements. + +* `element.disabled = true` prevents the element from taking focus and receiving events, and disabled buttons are greyed out. +* `element.hidden = true` in addition to the above, the element is not drawn. +* `element.title` can be changed for elements with a title. +* `element.value` can be changed for elements with a value. +* `element.flags` drawing flags for the element's text. If no flags were given at element creation, it defaults to `GUI.flags`. + +The various screen elements are added to the GUI with the functions described below. The functions all add the element to the GUI and returns a reference so the element subsequently can be accessed by the client. + +#### GUI.button (x, y, w, h, title, callBack \[, flags]) + +Add a button to the GUI. + +When tapped, it calls `callBack(self)` so a call back function can tell which button activated it. + +#### GUI.toggleButton(x, y, w, h, title, value, callBack \[, flags]) + +Add a toggle button to the GUI. + +The `value` is either `true` or `false`. + +When tapped, it calls `callBack(self)` so a call back function can tell which toggle button activated it, and what `self.value` is. + +#### GUI.number(x, y, w, h, value, changeValue \[, flags]) + +Add an editable number to the GUI. + +The `value` can be either a number or text. By setting the value to a text, it can be shown that the number is not present e.g. by "- -" or similar. + +When tapped, the number will go to edit mode. In edit mode, and `changeValue(d, self)` is called if the increase/decrease buttons are pressed, or a finger is slided up or down from the number. The parameter `d` is the number of "ticks" by which the number is being changed, and `changeValue` must return the new value for the number. In a simple case, the new value would just be `self.value + d`, but it could also select new values from a table etc. + +#### GUI.timer(x, y, w, h, tmr, changeValue \[, flags]) + +Add a timer to the GUI. + +If no `value` is present, then the model timer `tmr` will be shown. If `value` is a number, then it indicates the time in seconds, and it will be shown as **MM:SS**. The `value` can also be text, e.g. "- - : - -" to show that the timer is disabled. + +When tapped, the timer will go to edit mode, as described above for number. + +#### GUI.label(x, y, w, h, title\[, flags]) + +Add a text label to the GUI. + +The label does not respond to any events, but its `title` and `flags` can be changed. + +#### GUI.menu(x, y, w, h, items, callBack \[, flags]) + +Add a scrollable menu to the GUI. + +`items` is a table with the menu item texts. + +When a menu item is tapped, it calls `callBack(self)` and `self.selected` gets the index of the selected item. + +#### GUI.dropDown(x, y, w, h, items, selected, callBack, flags) + +Add a field with values that can be selected on a drop down menu. + +`items` is a table with the items that can be selected from. + +`selected` is the index of the initially selected item. + +When an item has been selected, it calls `callBack(self)`. The index of the selected item is given by `self.selected`. + +#### GUI.gui.horizontalSlider(x, y, w, value, min, max, delta, callBack) + +Adds a horizontal slider that starts at `(x, y)` and has the width `w`. + +`value` is the initial value, and `min - max` is the interval of values that can be selected with step size `delta`. + +When the value is changed, `callBack(self)` is called, and the value is given by `self.value`. + +#### GUI.gui.verticalSlider(x, y, w, value, min, max, delta, callBack) + +The same as the above, just vertical. + +#### gui.custom(self, x, y, w, h) + +This can be used to create your own custom GUI elements. `self` is a table containing the element. You must define the functions `self.draw(focused)` and `self.onEvent(event, touchState)`. There is a function `self.drawFocus(color)` defined that can draw a border around the element (use if focused == true). + +#### gui.gui(x, y, w, h) + +Create a nested sub-GUI. This can be used to group GUI elements which will be offset by `(x, y)` relative to the parent `GUI`. diff --git a/lua_api_reference/README.md b/lua_api_reference/README.md new file mode 100644 index 000000000..38b3c70ce --- /dev/null +++ b/lua_api_reference/README.md @@ -0,0 +1,4 @@ +# Part III - EdgeTX Lua API Reference + +This section describes the Lua libraries, functions and constants that are provided by EdgeTX. + diff --git a/lua_api_reference/bitmap/README.md b/lua_api_reference/bitmap/README.md new file mode 100644 index 000000000..751cdaae0 --- /dev/null +++ b/lua_api_reference/bitmap/README.md @@ -0,0 +1,2 @@ +# Bitmap Functions + diff --git a/lua_api_reference/bitmap/bitmap.resize-bitmap-width-height.md b/lua_api_reference/bitmap/bitmap.resize-bitmap-width-height.md new file mode 100644 index 000000000..e81f8ca72 --- /dev/null +++ b/lua_api_reference/bitmap/bitmap.resize-bitmap-width-height.md @@ -0,0 +1,19 @@ +# Bitmap.resize(bitmap, width, height) + +Return a resized bitmap object + +@status current Introduced in 2.8.0 + +**Parameters** + +* `bitmap` (pointer) point to a bitmap previously opened with Bitmap.open() +* `width` (number) the new bitmap width +* `height` (number) the new bitmap height + +**Return value** + +none + +**Notice** + +Only available on Horus diff --git a/lua_api_reference/bitmap/bitmap.tomask-bitmap.md b/lua_api_reference/bitmap/bitmap.tomask-bitmap.md new file mode 100644 index 000000000..72e9104a4 --- /dev/null +++ b/lua_api_reference/bitmap/bitmap.tomask-bitmap.md @@ -0,0 +1,17 @@ +# Bitmap.toMask(bitmap) + +Return a 8bit bitmap mask that can be used with lcd.drawBitmapPattern() + +@status current Introduced in 2.8.0 + +**Parameters** + +* `bitmap` (pointer) point to a bitmap previously opened with Bitmap.open() + +**Return value** + +* `a` bitmap mask + +**Notice** + +Only available on Horus diff --git a/lua_api_reference/bitmap/getsize.md b/lua_api_reference/bitmap/getsize.md new file mode 100644 index 000000000..347282bfa --- /dev/null +++ b/lua_api_reference/bitmap/getsize.md @@ -0,0 +1,29 @@ + + +## Bitmap.getSize(name) + + + +Return width, height of a bitmap object + +@status current Introduced in 2.2.0 + + +#### Parameters + +* `bitmap` (pointer) point to a bitmap previously opened with Bitmap.open() + + + +#### Return value + +* `multiple` returns 2 values: + * (number) width in pixels + * (number) height in pixels + + + +##### Notice +Only available on Horus + + diff --git a/lua_api_reference/bitmap/open.md b/lua_api_reference/bitmap/open.md new file mode 100644 index 000000000..45a6c8c3a --- /dev/null +++ b/lua_api_reference/bitmap/open.md @@ -0,0 +1,34 @@ + + +## Bitmap.open(name) + + + +Loads a bitmap in memory, for later use with lcd.drawBitmap(). Bitmaps should be loaded only +once, returned object should be stored and used for drawing. If loading fails for whatever +reason the resulting bitmap object will have width and height set to zero. + +Bitmap loading can fail if: + * File is not found or contains invalid image + * System is low on memory + * Combined memory usage of all Lua script bitmaps exceeds certain value + +@status current Introduced in 2.2.0 + + +#### Parameters + +* `name` (string) full path to the bitmap on SD card (i.e. “/IMAGES/test.bmp”) + + + +#### Return value + +* `bitmap` (object) a bitmap object that can be used with other bitmap functions + + + +##### Notice +Only available on Horus + + diff --git a/lua_api_reference/constants/README.md b/lua_api_reference/constants/README.md new file mode 100644 index 000000000..dfd982c95 --- /dev/null +++ b/lua_api_reference/constants/README.md @@ -0,0 +1,12 @@ +--- +description: This section describes various constants that are provided for Lua by EdgeTX. +--- + +# Constants + +* [Key Events](key_events.md) +* [Touch Events](touch-event-constants.md) +* [Flags and Patterns](flags-and-pattern-constants.md) +* [Colors](color-constants.md) +* [Screen size](screen-constants.md) + diff --git a/lua_api_reference/constants/color-constants.md b/lua_api_reference/constants/color-constants.md new file mode 100644 index 000000000..4e6558926 --- /dev/null +++ b/lua_api_reference/constants/color-constants.md @@ -0,0 +1,82 @@ +--- +description: >- + On radios with color display, a color may be added to the flags described + above. +--- + +# Color Constants + +There are two types of color constants: one that is an index into a table holding a palette of theme colors, and one that is just a color. + +## Indexed colors + +These are the theme colors plus CUSTOM\_COLOR, and they can be changed with the function lcd.setColor\(color\_index, color\). **Please note: if an indexed color is changed, then it changes everywhere that it is used. For the theme colors, this is not only in other widgets, but everywhere throughout the radio's user interface!** + +* COLOR\_THEME\_PRIMARY1 +* COLOR\_THEME\_PRIMARY2 +* COLOR\_THEME\_PRIMARY3 +* COLOR\_THEME\_SECONDARY1 +* COLOR\_THEME\_SECONDARY2 +* COLOR\_THEME\_SECONDARY3 +* COLOR\_THEME\_FOCUS +* COLOR\_THEME\_EDIT +* COLOR\_THEME\_ACTIVE +* COLOR\_THEME\_WARNING +* COLOR\_THEME\_DISABLED +* CUSTOM\_COLOR + +## Literal colors + +These color constants cannot be changed: + +* BLACK +* WHITE +* LIGHTWHITE +* YELLOW +* BLUE +* DARKBLUE +* GREY +* DARKGREY +* LIGHTGREY +* RED +* DARKRED +* GREEN +* DARKGREEN +* LIGHTBROWN +* DARKBROWN +* BRIGHTGREEN +* ORANGE + +## Deprecated color constants + +These should no longer be used, but they are included for backwards compatibility. The old OpenTX API had a large number of indexed theme colors, and these have been mapped to the new theme colors as follows: + +* ALARM\_COLOR -> COLOR\_THEME\_WARNING +* BARGRAPH\_BGCOLOR -> COLOR\_THEME\_SECONDARY3 +* BARGRAPH1\_COLOR -> COLOR\_THEME\_SECONDARY1 +* BARGRAPH2\_COLOR -> COLOR\_THEME\_SECONDARY2 +* CURVE\_AXIS\_COLOR -> COLOR\_THEME\_SECONDARY2 +* CURVE\_COLOR -> COLOR\_THEME\_SECONDARY1 +* CURVE\_CURSOR\_COLOR -> COLOR\_THEME\_WARNING +* HEADER\_BGCOLOR -> COLOR\_THEME\_FOCUS +* HEADER\_COLOR -> COLOR\_THEME\_SECONDARY1 +* HEADER\_CURRENT\_BGCOLOR -> COLOR\_THEME\_FOCUS +* HEADER\_ICON\_BGCOLOR -> COLOR\_THEME\_SECONDARY1 +* LINE\_COLOR -> COLOR\_THEME\_PRIMARY3 +* MAINVIEW\_GRAPHICS\_COLOR -> COLOR\_THEME\_SECONDARY1 +* MAINVIEW\_PANES\_COLOR -> COLOR\_THEME\_PRIMARY2 +* MENU\_TITLE\_BGCOLOR -> COLOR\_THEME\_SECONDARY1 +* MENU\_TITLE\_COLOR -> COLOR\_THEME\_PRIMARY2 +* MENU\_TITLE\_DISABLE\_COLOR -> COLOR\_THEME\_PRIMARY3 +* OVERLAY\_COLOR -> COLOR\_THEME\_PRIMARY1 +* SCROLLBOX\_COLOR -> COLOR\_THEME\_SECONDARY3 +* TEXT\_BGCOLOR -> COLOR\_THEME\_SECONDARY3 +* TEXT\_COLOR -> COLOR\_THEME\_SECONDARY1 +* TEXT\_DISABLE\_COLOR -> COLOR\_THEME\_DISABLED +* TEXT\_INVERTED\_BGCOLOR -> COLOR\_THEME\_FOCUS +* TEXT\_INVERTED\_COLOR -> COLOR\_THEME\_PRIMARY2 +* TITLE\_BGCOLOR -> COLOR\_THEME\_SECONDARY1 +* TRIM\_BGCOLOR -> COLOR\_THEME\_FOCUS +* TRIM\_SHADOW\_COLOR -> COLOR\_THEME\_PRIMARY1 +* WARNING\_COLOR -> COLOR\_THEME\_WARNING + diff --git a/lua_api_reference/constants/flags-and-pattern-constants.md b/lua_api_reference/constants/flags-and-pattern-constants.md new file mode 100644 index 000000000..160117f3b --- /dev/null +++ b/lua_api_reference/constants/flags-and-pattern-constants.md @@ -0,0 +1,38 @@ +--- +description: >- + Many of the lcd functions accept parameters named flags and patterns. The + names and their meanings are described below. +--- + +# Flags and Pattern Constants + +## Flags + +| Name | Description | Version | Notes | +| :--- | :--- | :--- | :--- | +| 0 | normal font, default precision for numeric | | | +| XXLSIZE | jumbo font | 2.0.6 | | +| DBLSIZE | double size font | | | +| MIDSIZE | mid sized font | | | +| SMLSIZE | small font | | | +| BOLD | bold font | | Only color displays. This is a font size on its own - cannot be combined with other font size flags. | +| SHADOWED | shadow font | | Only color displays | +| INVERS | inverted display | | | +| BLINK | blinking text | | | +| LEFT | left justify | 2.0.6 | Default for most functions not related to bitmaps | +| RIGHT | right justify | | | +| CENTER | center justify | | Only color displays | +| VCENTER | center vertically | 2.5.0 | Only color displays | +| PREC1 | single decimal place | | | +| PREC2 | two decimal places | | | +| GREY\_DEFAULT | grey fill | | | +| TIMEHOUR | display hours | | Only for drawTimer | + +## Patterns + +| Name | Description | +| :--- | :--- | +| FORCE | pixels will be black | +| ERASE | pixels will be white | +| DOTTED | lines will appear dotted | + diff --git a/lua_api_reference/constants/key_events.md b/lua_api_reference/constants/key_events.md new file mode 100644 index 000000000..33f682306 --- /dev/null +++ b/lua_api_reference/constants/key_events.md @@ -0,0 +1,82 @@ +--- +description: >- + This page describes the value that is passed to scripts in the event + parameter. It is used in Telemetry and One-Time scripts, as well as widget + scripts in full screen mode. +--- + +# Key Event Constants + +## The key event mechanism + +Each time a key is pressed, held and released a number of events get generated. Here is a typical flow: + +* when a key is pressed a `FIRST` event is generated +* if the key continues to be pressed, then after a while a `LONG` event is generated +* if the key continues to be pressed, then a `REPEAT` events are being generated +* when the key is released a `BREAK` event is generated + +Couple of examples: + +* a short press on key would generate: `FIRST`, `BREAK` +* a longer pres on key would generate: `FIRST`, `LONG`, `BREAK` +* even longer press: `FIRST`, `LONG`, `REPEAT,`REPEAT, ..., `BREAK` + +This normal key event sequence can be altered with the [killEvents(key)](../general-functions-less-than-greater-than-luadoc-begin-general/killevents.md) function. Any time this function is called (after the `FIRST` event) all further key events for this key will be suppressed until the next key press of this key. Examples: + +* kill immediately after the key press would generate: `FIRST` +* kill after the long key press would generate: `FIRST`, `LONG` + +## Constants + +The `event` parameter in the [Telemetry](../../part\_i\_-\_script\_type\_overview/telemetry.md) and [One-Time](https://github.com/opentx/opentx-2-3-lua-reference-guide/tree/0d355d19f1961b689994cf78b84005864d33f9b5/one-time\_scripts.md) scripts run function actually carries two pieces of information: + +* key number +* type of event + +The two fields are combined into one single number. Some of these combinations are defined as constants and are available to Lua scripts: + +| Key Event Name | Comments | +| :---------------: | :---------------------: | +| EVT\_MENU\_BREAK | **MENU** key release | +| EVT\_PAGE\_BREAK | **PAGE** key release | +| EVT\_PAGE\_LONG | **MENU** key long press | +| EVT\_ENTER\_BREAK | **ENT** key release | +| EVT\_ENTER\_LONG | **ENT** key long press | +| EVT\_EXIT\_BREAK | **EXIT** key release | +| EVT\_PLUS\_BREAK | **+** key release | +| EVT\_MINUS\_BREAK | **-** key release | +| EVT\_PLUS\_FIRST | **+** key press | +| EVT\_MINUS\_FIRST | **-** key press | +| EVT\_PLUS\_REPT | **+** key repeat | +| EVT\_MINUS\_REPT | **-** key repeat | + +Radios with rotary encoder (X7 and Horus) have also: + +| Key Event Name | Comments | +| :-------------: | :--------------------------: | +| EVT\_ROT\_BREAK | rotary encoder release | +| EVT\_ROT\_LONG | rotary encoder long press | +| EVT\_ROT\_LEFT | rotary encoder rotated left | +| EVT\_ROT\_RIGHT | rotary encoder rotated right | + +## Virtual events + +Given the large number of radios supported by OpenTX, and the large difference in keys available on those, a set of VIRTUAL KEYS has been defined and are mapped to best fit available hardware + +| Virtual Key Event Name | Comments | +| :-----------------------: | :-------------------: | +| EVT\_VIRTUAL\_NEXT\_PAGE | for PAGE navigation | +| EVT\_VIRTUAL\_PREV\_PAGE | for PAGE navigation | +| EVT\_VIRTUAL\_ENTER | | +| EVT\_VIRTUAL\_ENTER\_LONG | | +| EVT\_VIRTUAL\_MENU | | +| EVT\_VIRTUAL\_MENU\_LONG | | +| EVT\_VIRTUAL\_NEXT | for FIELDS navigation | +| EVT\_VIRTUAL\_NEXT\_REPT | for FIELDS navigation | +| EVT\_VIRTUAL\_PREV | for FIELDS navigation | +| EVT\_VIRTUAL\_PREV\_REPT | for FIELDS navigation | +| EVT\_VIRTUAL\_INC | for VALUES navigation | +| EVT\_VIRTUAL\_INC\_REPT | for VALUES navigation | +| EVT\_VIRTUAL\_DEC | for VALUES navigation | +| EVT\_VIRTUAL\_DEC\_REPT | for VALUES navigation | diff --git a/lua_api_reference/constants/logical-switch-function-constants.md b/lua_api_reference/constants/logical-switch-function-constants.md new file mode 100644 index 000000000..69b740c14 --- /dev/null +++ b/lua_api_reference/constants/logical-switch-function-constants.md @@ -0,0 +1,25 @@ +--- +description: These constants give the type of logical switch function. +--- + +# Logical Switch Function Constants + +* LS\_FUNC\_NONE +* LS\_FUNC\_VEQUAL +* LS\_FUNC\_VALMOSTEQUAL +* LS\_FUNC\_VPOS +* LS\_FUNC\_VNEG +* LS\_FUNC\_RANGE +* LS\_FUNC\_APOS +* LS\_FUNC\_ANEG +* LS\_FUNC\_AND +* LS\_FUNC\_OR +* LS\_FUNC\_XOR +* LS\_FUNC\_EDGE +* LS\_FUNC\_EQUAL +* LS\_FUNC\_GREATER +* LS\_FUNC\_LESS +* LS\_FUNC\_DIFFEGREATER +* LS\_FUNC\_ADIFFEGREATER +* LS\_FUNC\_TIMER +* LS\_FUNC\_STICKY diff --git a/lua_api_reference/constants/screen-constants.md b/lua_api_reference/constants/screen-constants.md new file mode 100644 index 000000000..7f4e9872a --- /dev/null +++ b/lua_api_reference/constants/screen-constants.md @@ -0,0 +1,7 @@ +# Screen Constants + +| Name | Description | +| :--- | :--- | +| LCD\_W | width in pixels | +| LCD\_H | height in pixels | + diff --git a/lua_api_reference/constants/special-character-constants.md b/lua_api_reference/constants/special-character-constants.md new file mode 100644 index 000000000..f6eeae327 --- /dev/null +++ b/lua_api_reference/constants/special-character-constants.md @@ -0,0 +1,23 @@ +--- +description: The radio's special characters can be used with the following text constants. +--- + +# Special Character Constants + +* CHAR\_RIGHT +* CHAR\_LEFT +* CHAR\_UP +* CHAR\_DOWN +* CHAR\_DELTA +* CHAR\_STICK +* CHAR\_POT +* CHAR\_SLIDER +* CHAR\_SWITCH +* CHAR\_TRIM +* CHAR\_INPUT +* CHAR\_FUNCTION +* CHAR\_CYC +* CHAR\_TRAINER +* CHAR\_CHANNEL +* CHAR\_TELEMETRY +* CHAR\_LUA diff --git a/lua_api_reference/constants/special-function-constants.md b/lua_api_reference/constants/special-function-constants.md new file mode 100644 index 000000000..cddc4220a --- /dev/null +++ b/lua_api_reference/constants/special-function-constants.md @@ -0,0 +1,30 @@ +--- +description: These constants determine the type of a Special Function +--- + +# Special Function Constants + +* FUNC\_OVERRIDE\_CHANNEL +* FUNC\_TRAINER +* FUNC\_INSTANT\_TRIM +* FUNC\_RESET +* FUNC\_SET\_TIMER +* FUNC\_ADJUST\_GVAR +* FUNC\_VOLUME +* FUNC\_SET\_FAILSAFE +* FUNC\_RANGECHECK +* FUNC\_BIND +* FUNC\_PLAY\_SOUND +* FUNC\_PLAY\_TRACK +* FUNC\_PLAY\_VALUE +* FUNC\_PLAY\_SCRIPT +* FUNC\_RESERVE5 +* FUNC\_BACKGND\_MUSIC +* FUNC\_BACKGND\_MUSIC\_PAUSE +* FUNC\_VARIO +* FUNC\_HAPTIC +* FUNC\_LOGS +* FUNC\_BACKLIGHT +* FUNC\_SCREENSHOT +* FUNC\_RACING\_MODE +* FUNC\_DISABLE\_TOUCH diff --git a/lua_api_reference/constants/touch-event-constants.md b/lua_api_reference/constants/touch-event-constants.md new file mode 100644 index 000000000..6e5b6003a --- /dev/null +++ b/lua_api_reference/constants/touch-event-constants.md @@ -0,0 +1,37 @@ +--- +description: >- + In addition to the key events described in the previous section, radios with a + color touch screen also provide touch events to the widget scripts. +--- + +# Touch Event Constants + +The following touch events are passed in the `event` argument to the widget script `refresh` function \(when in full screen mode\), just like the key events. The following touch events are provided: + +| Touch Event Name | Description | +| :---: | :---: | +| EVT\_TOUCH\_FIRST | When the finger touches down on the screen | +| EVT\_TOUCH\_TAP | If the finger leaves the screen after a quick tap | +| EVT\_TOUCH\_BREAK | If the finger leaves the screen without tap or slide | +| EVT\_TOUCH\_SLIDE | Repeats while the finger is sliding on the screen | + +In addition to the above touch events a `touchState` table is passed to `refresh` with the following addional data fields: + +| touchState fields | Description | +| :---: | :---: | +| x, y | Current touch point | +| startX, startY | Point where slide started | +| slideX, SlideY | Movement since previous SLIDE event \(or start of slide\) | +| swipeUp / swipeDown / swipeLeft / swipeRight | The field is present and equal to `true` if a swipe event occurred in that direction | +| tapCount | Counts the number of consecutive taps | + +## Notes: + +* `touchState` is `nil` if `event` is not a touch event. This can be used to test if we have a touch event or a key event. + * Since Lua evaluates a `nil` value to `false` and everything else to `true`: + * `if touchState then` we have a touch event. +* `x, y` are present for all touch events. +* `startX, startY, slideX, slideY` are only present with `EVT_TOUCH_SLIDE`. +* `swipeUp` / `swipeDown` / `swipeLeft` / `swipeRight` _may_ be present only with`EVT_TOUCH_SLIDE`. +* `tapCount` is zero for anything but `EVT_TOUCH_TAP`. + diff --git a/lua_api_reference/constants/widget-options.md b/lua_api_reference/constants/widget-options.md new file mode 100644 index 000000000..352de94a2 --- /dev/null +++ b/lua_api_reference/constants/widget-options.md @@ -0,0 +1,33 @@ +# Widget Options Constants + +There are several option types that can be specified in the widget options table, which are exposed to the user via the Widget Settings menu.\ +\ +For example: + +``` +-- Create a table with default options +-- Options can be changed by the user from the Widget Settings menu +-- Notice that each line is a table inside { } +local options = { + { "Source", SOURCE, 1 }, + -- BOOL is actually not a boolean, but toggles between 0 and 1 + { "Boolean", BOOL, 1 }, + { "Value", VALUE, 1, 0, 10}, + { "Color", COLOR, ORANGE }, + { "Text", STRING, "Max8chrs" } +} + +``` + + + +| Type | Description | +| ---------- | ---------------------------------------------------------------------------------------- | +| COLOR | Displays a color picker, returns a color flag value | +| BOOL | Displays a toggle/checkbox, value toggles between 0 and 1 | +| STRING | Text input option, limited to 8 characters | +| TIMER | Choice option, lets you pick from available timers | +| SOURCE | Choice option, lets you pick from available sources (i.e. sticks, switches, LS) | +| VALUE | Numerical input option, can specify default, min and max value | +| TEXT\_SIZE | Choice option, lets you pick from the available text sizes (i.e. small, large) | +| ALIGNMENT | Choice option, lets you pick from available alignment options (i.e. left, center, right) | diff --git a/lua_api_reference/filesystem/README.md b/lua_api_reference/filesystem/README.md new file mode 100644 index 000000000..7a2370799 --- /dev/null +++ b/lua_api_reference/filesystem/README.md @@ -0,0 +1,2 @@ +# Filesystem + diff --git a/lua_api_reference/filesystem/del-file-or-directory.md b/lua_api_reference/filesystem/del-file-or-directory.md new file mode 100644 index 000000000..2a021fc24 --- /dev/null +++ b/lua_api_reference/filesystem/del-file-or-directory.md @@ -0,0 +1,21 @@ +# del(file or directory) + +@status current Introduced in 2.9.0 + +## Example + +```lua + if del("/SCRIPTS/TOOLS/deleteme.txt") == 0 then + -- successfully deleted file + else + -- failed to delete file + end +``` + +### Parameters + +Path to file or directory to be deleted + +### Return value + +Returns FRESULT (e.g. 0=OK, 4=File not found, 5=Path not found, 6=Path invalid) diff --git a/lua_api_reference/filesystem/dir-directory.md b/lua_api_reference/filesystem/dir-directory.md new file mode 100644 index 000000000..57c36e2d5 --- /dev/null +++ b/lua_api_reference/filesystem/dir-directory.md @@ -0,0 +1,24 @@ +# dir\(directory\) + +Return an iterator listing all the files and directories name in a directory + +@status current Introduced in 2.5.0 + +**Parameters** + +* `directory` \(string\) Working directory + +**Return value** + +none + +#### Example + +```lua + local var y = 40 + for fname in dir("/SCRIPTS") do + lcd.drawText(5,y, fname, TEXT_COLOR) + y = y + 20 + end +``` + diff --git a/lua_api_reference/filesystem/fstat-path.md b/lua_api_reference/filesystem/fstat-path.md new file mode 100644 index 000000000..6ad5aa528 --- /dev/null +++ b/lua_api_reference/filesystem/fstat-path.md @@ -0,0 +1,41 @@ +# fstat\(path\) + +Checks the existence of file or directory. +If not exist, return nil. +If exist, return the object information. + +@status current Introduced in 2.5.0 + +**Parameters** + +* `path` \(string\) path to the object + +**Return value** + +* `table` object info, table elements: +* `size` \(number\) file size +* `attrib` \(number\) file attribute flags +* `time` \(table\) table with last time modified date and times, table elements: + * `year` \(number\) year + * `mon` \(number\) month + * `day` \(number\) day of month + * `hour` \(number\) hours + * `hour12` \(number\) hours in US format + * `min` \(number\) minutes + * `sec` \(number\) seconds + * `suffix` \(text\) am or pm + +#### Example + +```lua + info = fstat("radio") + if info ~= nil then + if (info.attrib == AM_DIR) then + print("is a directory") + end + + size = info.size + time = info.time + end +``` + diff --git a/lua_api_reference/general/README.md b/lua_api_reference/general/README.md new file mode 100644 index 000000000..0a55ad401 --- /dev/null +++ b/lua_api_reference/general/README.md @@ -0,0 +1,2 @@ +# General Functions + diff --git a/lua_api_reference/general/accesstelemetrypush.md b/lua_api_reference/general/accesstelemetrypush.md new file mode 100644 index 000000000..bf180de75 --- /dev/null +++ b/lua_api_reference/general/accesstelemetrypush.md @@ -0,0 +1,21 @@ +# accessTelemetryPush\(\) + +This functions allows for sending SPORT / ACCESS telemetry data toward the receiver, and more generally, to anything connected SPORT bus on the receiver or transmitter. + +When called without parameters, it will only return the status of the output buffer without sending anything. + +@status current Introduced in 2.3 + +## Parameters + +* `module` module index \(0 = internal, 1 = external\) +* `rxUid` receiver index +* `sensorId` physical sensor ID +* `frameId` frame ID +* `dataId` data ID +* `value` value + +## Return value + +* `boolean` data queued in output buffer or not. + diff --git a/lua_api_reference/general/chdir.md b/lua_api_reference/general/chdir.md new file mode 100644 index 000000000..ecb58c5db --- /dev/null +++ b/lua_api_reference/general/chdir.md @@ -0,0 +1,14 @@ +# chdir\(directory\) + +Change the working directory + +@status current Introduced in 2.3.0 + +## Parameters + +* `directory` \(string\) New working directory + +## Return value + +none + diff --git a/lua_api_reference/general/crossfiretelemetrypop.md b/lua_api_reference/general/crossfiretelemetrypop.md new file mode 100644 index 000000000..75e7b25eb --- /dev/null +++ b/lua_api_reference/general/crossfiretelemetrypop.md @@ -0,0 +1,17 @@ +# crossfireTelemetryPop\(\) + +Pops a received Crossfire Telemetry packet from the queue. + +@status current Introduced in 2.2.0 + +## Parameters + +none + +## Return value + +* `nil` queue does not contain any \(or enough\) bytes to form a whole packet +* `multiple` returns 2 values: + * command \(number\) + * packet \(table\) data bytes + diff --git a/lua_api_reference/general/crossfiretelemetrypush.md b/lua_api_reference/general/crossfiretelemetrypush.md new file mode 100644 index 000000000..ad1c146a7 --- /dev/null +++ b/lua_api_reference/general/crossfiretelemetrypush.md @@ -0,0 +1,18 @@ +# crossfireTelemetryPush\(\) + +This functions allows for sending telemetry data toward the TBS Crossfire link. + +When called without parameters, it will only return the status of the output buffer without sending anything. + +@status current Introduced in 2.2.0, retval nil added in 2.3.4 + +## Parameters + +* `command` command +* `data` table of data bytes + +## Return value + +* `boolean` data queued in output buffer or not. +* `nil` incorrect telemetry protocol. + diff --git a/lua_api_reference/general/defaultchannel.md b/lua_api_reference/general/defaultchannel.md new file mode 100644 index 000000000..8b0668905 --- /dev/null +++ b/lua_api_reference/general/defaultchannel.md @@ -0,0 +1,15 @@ +# defaultChannel\(stick\) + +Get channel assigned to stick. See Default Channel Order in General Settings + +@status current Introduced in 2.0.0 + +## Parameters + +* `stick` \(number\) stick number \(from 0 to 3\) + +## Return value + +* `number` channel assigned to this stick \(from 0 to 3\) +* `nil` stick not found + diff --git a/lua_api_reference/general/defaultstick.md b/lua_api_reference/general/defaultstick.md new file mode 100644 index 000000000..8a81314b9 --- /dev/null +++ b/lua_api_reference/general/defaultstick.md @@ -0,0 +1,14 @@ +# defaultStick\(channel\) + +Get stick that is assigned to a channel. See Default Channel Order in General Settings. + +@status current Introduced in 2.0.0 + +## Parameters + +* `channel` \(number\) channel number \(0 means CH1\) + +## Return value + +* `number` Stick assigned to this channel \(from 0 to 3\) + diff --git a/lua_api_reference/general/flushaudio.md b/lua_api_reference/general/flushaudio.md new file mode 100644 index 000000000..f2ee847a5 --- /dev/null +++ b/lua_api_reference/general/flushaudio.md @@ -0,0 +1,13 @@ +# flushAudio() + +Flushes audio queue + +@status experimental, Introduced in 2.8.0 + +**Parameters** + +none + +**Return value** + +none diff --git a/lua_api_reference/general/getavailablememory.md b/lua_api_reference/general/getavailablememory.md new file mode 100644 index 000000000..eabeda44a --- /dev/null +++ b/lua_api_reference/general/getavailablememory.md @@ -0,0 +1,12 @@ +# getAvailableMemory\(\) + +Get available memory remaining in the Heap for Lua. + +## Parameters + +none + +## Return value + +* `usage` \(number\) a value returned in b + diff --git a/lua_api_reference/general/getdatetime.md b/lua_api_reference/general/getdatetime.md new file mode 100644 index 000000000..65be5d530 --- /dev/null +++ b/lua_api_reference/general/getdatetime.md @@ -0,0 +1,20 @@ +# getDateTime\(\) + +Return current system date and time that is kept by the RTC unit + +## Parameters + +none + +## Return value + +* `table` current date and time, table elements: + * `year` \(number\) year + * `mon` \(number\) month + * `day` \(number\) day of month + * `hour` \(number\) hours + * `hour12` \(number\) hours in US format + * `min` \(number\) minutes + * `sec` \(number\) seconds + * `suffix` \(text\) am or pm + diff --git a/lua_api_reference/general/getfieldinfo.md b/lua_api_reference/general/getfieldinfo.md new file mode 100644 index 000000000..fdff705e1 --- /dev/null +++ b/lua_api_reference/general/getfieldinfo.md @@ -0,0 +1,27 @@ +# getFieldInfo(source) + +Return detailed information about field (source) + +The list of valid sources is available: + +| OpenTX Version | Radio | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| 2.0 | [all](http://downloads-20.open-tx.org/firmware/lua\_fields.txt) | +| 2.1 | [X9D and X9D+](http://downloads-21.open-tx.org/firmware/lua\_fields\_taranis.txt), [X9E](http://downloads-21.open-tx.org/firmware/lua\_fields\_taranis\_x9e.txt) | +| 2.2 | [X9D and X9D+](http://downloads.open-tx.org/2.2/release/firmware/lua\_fields\_x9d.txt), [X9E](http://downloads.open-tx.org/2.2/release/firmware/lua\_fields\_x9e.txt), [Horus](http://downloads.open-tx.org/2.2/release/firmware/lua\_fields\_x12s.txt) | +| 2.3 | [X9D and X9D+](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x9d.txt), [X9E](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x9e.txt), [X7](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x7.txt), [Horus](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x12s.txt) | + +@status current Introduced in 2.0.8, 'unit' field added in 2.2.0 + +## Parameters + +* `source` can be an identifier (number) or a name (string) of the source. + +## Return value + +* `table` information about requested field, table elements: + * `id` (number) field identifier + * `name` (string) field name + * `desc` (string) field description + * 'unit' (number) unit identifier [Full list](../../appendix/units.md) +* `nil` the requested field was not found diff --git a/lua_api_reference/general/getflightmode.md b/lua_api_reference/general/getflightmode.md new file mode 100644 index 000000000..3f64688fa --- /dev/null +++ b/lua_api_reference/general/getflightmode.md @@ -0,0 +1,18 @@ +# getFlightMode\(mode\) + +Return flight mode data. + +@status current Introduced in 2.1.7 + +## Parameters + +* `mode` \(number\) flight mode number to return \(0 - 8\). If mode parameter + + is not specified \(or contains invalid value\), then the current flight mode data is returned. + +## Return value + +* `multiple` returns 2 values: + * \(number\) \(current\) flight mode number \(0 - 8\) + * \(string\) \(current\) flight mode name + diff --git a/lua_api_reference/general/getgeneralsettings.md b/lua_api_reference/general/getgeneralsettings.md new file mode 100644 index 000000000..9a00e30b3 --- /dev/null +++ b/lua_api_reference/general/getgeneralsettings.md @@ -0,0 +1,24 @@ +# getGeneralSettings\(\) + +Returns \(some of\) the general radio settings + +@status current Introduced in 2.0.6, `imperial` added in TODO, `language` and `voice` added in 2.2.0, gtimer added in 2.2.2. + +## Parameters + +none + +## Return value + +* `table` with elements: + * `battWarn` \(number\) radio battery range - warning value + * `battMin` \(number\) radio battery range - minimum value + * `battMax` \(number\) radio battery range - maximum value + * `imperial` \(number\) set to a value different from 0 if the radio is set to the + + IMPERIAL units + + * `language` \(string\) radio language \(used for menus\) + * `voice` \(string\) voice language \(used for speech\) + * `gtimer` \(number\) radio global timer in seconds \(does not include current session\) + diff --git a/lua_api_reference/general/getglobaltimer.md b/lua_api_reference/general/getglobaltimer.md new file mode 100644 index 000000000..13f810dae --- /dev/null +++ b/lua_api_reference/general/getglobaltimer.md @@ -0,0 +1,18 @@ +# getGlobalTimer\(\) + +Returns radio timers + +@status current Introduced added in 2.3.0. + +## Parameters + +none + +## Return value + +* `table` with elements: +* `gtimer` \(number\) radio global timer in seconds +* `session` \(number\) radio session in seconds +* `ttimer` \(number\) radio throttle timer in seconds +* `tptimer` \(number\) radio throttle percent timer in seconds + diff --git a/lua_api_reference/general/getlogicalswitchvalue-id.md b/lua_api_reference/general/getlogicalswitchvalue-id.md new file mode 100644 index 000000000..17bfcab2a --- /dev/null +++ b/lua_api_reference/general/getlogicalswitchvalue-id.md @@ -0,0 +1,13 @@ +# getLogicalSwitchValue(id) + +Reads the value of a logical switch. + +@status current Introduced in 2.6 + +## Parameter + +* `id`: integer identifying the logical switch (zero for L01 etc.). + +## Return value + +* `value`: true/false. diff --git a/lua_api_reference/general/getoutputvalue-outputindex.md b/lua_api_reference/general/getoutputvalue-outputindex.md new file mode 100644 index 000000000..a6f42cd96 --- /dev/null +++ b/lua_api_reference/general/getoutputvalue-outputindex.md @@ -0,0 +1,12 @@ +# getOutputValue(outputIndex) + +@status current Introduced in 2.8.0 + +**Parameters** + +* `outputIndex:` integer identifying the output channel number 0 for CH1, up to MAX\_OUTPUT\_CHANNELS - 1. + +**Return value** + +* `value` current output value (number). Zero is returned for: +* non-existing outputs diff --git a/lua_api_reference/general/getras.md b/lua_api_reference/general/getras.md new file mode 100644 index 000000000..a8a2bb442 --- /dev/null +++ b/lua_api_reference/general/getras.md @@ -0,0 +1,20 @@ +# getRAS\(\) + +Return the RAS value or nil if no valid hardware found + +@status current Introduced in 2.2.0 + +## Parameters + +none + +## Return value + +* `number` representing RAS value. Value bellow 0x33 \(51 decimal\) are all ok, value above 0x33 indicate a hardware antenna issue. + + This is just a hardware pass/fail measure and does not represent the quality of the radio link + +### Notice + +RAS was called SWR in the past + diff --git a/lua_api_reference/general/getrotencmode.md b/lua_api_reference/general/getrotencmode.md new file mode 100644 index 000000000..d3bebe4f7 --- /dev/null +++ b/lua_api_reference/general/getrotencmode.md @@ -0,0 +1,14 @@ +# getRotEncMode() + +Return rotary encoder mode + +@status current Introduced in 2.8.0 + +**Parameters** + +none + +**Return value** + +* `number` in list: Normal = 0, Both V and H inverted = 1, V-N = 2, V-A = 3 +* `return 0` on radio without rotary encoder diff --git a/lua_api_reference/general/getrotencspeed.md b/lua_api_reference/general/getrotencspeed.md new file mode 100644 index 000000000..5638024b6 --- /dev/null +++ b/lua_api_reference/general/getrotencspeed.md @@ -0,0 +1,14 @@ +# getRotEncSpeed() + +Return rotary encoder current speed + +@status current Introduced in 2.3.10 + +## Parameters + +none + +## Return value + +* `number` in list: ROTENC\_LOWSPEED, ROTENC\_MIDSPEED, ROTENC\_HIGHSPEED +* `return 0` on radio without rotary encoder diff --git a/lua_api_reference/general/getrssi.md b/lua_api_reference/general/getrssi.md new file mode 100644 index 000000000..e9e453f46 --- /dev/null +++ b/lua_api_reference/general/getrssi.md @@ -0,0 +1,16 @@ +# getRSSI\(\) + +Get RSSI value as well as low and critical RSSI alarm levels \(in dB\) + +@status current Introduced in 2.2.0 + +## Parameters + +none + +## Return value + +* `rssi` RSSI value \(0 if no link\) +* `alarm_low` Configured low RSSI alarm level +* `alarm_crit` Configured critical RSSI alarm level + diff --git a/lua_api_reference/general/getrtctime.md b/lua_api_reference/general/getrtctime.md new file mode 100644 index 000000000..dc0f24e7d --- /dev/null +++ b/lua_api_reference/general/getrtctime.md @@ -0,0 +1,14 @@ +# getRtcTime\(\) + +Return current RTC system date as unix timstamp \(in seconds since 1. Jan 1970\) + +Please note the RTC timestamp is kept internally as a 32bit integer, which will overflow in 2038. + +## Parameters + +none + +## Return value + +* `number` Number of seconds elapsed since 1. Jan 1970 + diff --git a/lua_api_reference/general/getshmvar-id.md b/lua_api_reference/general/getshmvar-id.md new file mode 100644 index 000000000..078b07183 --- /dev/null +++ b/lua_api_reference/general/getshmvar-id.md @@ -0,0 +1,17 @@ +# getShmVar(id) + +Gets the value of a shared memory variable that can be used for passing data between Lua widgets and other Lua scripts. + +@status current Introduced in 2.6 + +**Parameters** + +* `id:` integer between 1 and 16 identifying the shared memory variable. + +**Return value** + +* `value:` integer. The value of the shared memory variable. + +**Notice** + +Only available on radios with color display diff --git a/lua_api_reference/general/getsourceindex-sourcename.md b/lua_api_reference/general/getsourceindex-sourcename.md new file mode 100644 index 000000000..2301309e2 --- /dev/null +++ b/lua_api_reference/general/getsourceindex-sourcename.md @@ -0,0 +1,19 @@ +# getSourceIndex(sourceName) + +#### Parameters + +* `sourceName`: string naming a value source as it is shown on radio menus where you can select it. Notice that many names have [special characters](../constants/special-character-constants.md) in them. + +Return value + +* `sourceIndex`: integer. The source index, which can be used as input for `getSourceName(sourceIndex)`, `getValue(sourceIndex)`, and `getFieldInfo(sourceIndex)`. + +#### Notice + +The source names shown on the screen are not the same as the names used by `getFieldInfo` and `getValue`. But the indices are the same, so e.g. `getValue(index)` will work with the indices obtained here. + +This function is rather time consuming, and should not be used repeatedly in a script, if it can be avoided. + +#### Status + +Current Introduced in 2.6 diff --git a/lua_api_reference/general/getsourcename-sourceindex.md b/lua_api_reference/general/getsourcename-sourceindex.md new file mode 100644 index 000000000..7e8ef040a --- /dev/null +++ b/lua_api_reference/general/getsourcename-sourceindex.md @@ -0,0 +1,17 @@ +# getSourceName(sourceIndex) + +#### Parameters + +* `sourceIndex`: integer identifying a value source as returned by `getSourceIndex(sourceName)` or the `id` field in the table returned by `getFieldInfo`. + +#### Return value + +* `sourceName`: string naming the value source as it is shown on radio menus where a source can be chosen. + +#### Notice + +The source names shown on the screen are not the same as the names used by `getFieldInfo` and `getValue`. But the indices are the same, so e.g. `getValue(index)` will work with the indices used here. + +#### Status + +Current Introduced in 2.6 diff --git a/lua_api_reference/general/getsourcevalue-source.md b/lua_api_reference/general/getsourcevalue-source.md new file mode 100644 index 000000000..551a95d5a --- /dev/null +++ b/lua_api_reference/general/getsourcevalue-source.md @@ -0,0 +1,51 @@ +# getSourceValue(source) + +Returns the value of a source. Supersedes `getValue`. + +The list of fixed sources: + +| OpenTX Version | Radio | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| 2.0 | [all](http://downloads-20.open-tx.org/firmware/lua\_fields.txt) | +| 2.1 | [X9D and X9D+](http://downloads-21.open-tx.org/firmware/lua\_fields\_taranis.txt), [X9E](http://downloads-21.open-tx.org/firmware/lua\_fields\_taranis\_x9e.txt) | +| 2.2 | [X9D and X9D+](http://downloads.open-tx.org/2.2/release/firmware/lua\_fields\_x9d.txt), [X9E](http://downloads.open-tx.org/2.2/release/firmware/lua\_fields\_x9e.txt), [Horus](http://downloads.open-tx.org/2.2/release/firmware/lua\_fields\_x12s.txt) | +| 2.3 | [X9D and X9D+](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x9d.txt), [X9E](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x9e.txt), [X7](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x7.txt), [Horus](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x12s.txt) | + +In OpenTX 2.1.x the telemetry sources no longer have a predefined name. To get a telemetry value simply use it's sensor name. For example: + +* Altitude sensor has a name "Alt" +* to get the current altitude use the source "Alt" +* to get the minimum altitude use the source "Alt-", to get the maximum use "Alt+" + +value is nil for non-existing sources. all non-allowed sensors while FAI MODE is active, or if a telemetry item value has never been received + +value is a table for GPS position: + +* `lat` (number) latitude, positive is North +* `lon` (number) longitude, positive is East +* `pilot-lat` (number) pilot latitude, positive is North +* `pilot-lon` (number) pilot longitude, positive is East + +value is a table for date/time, see getDateTime() + +value is a table for battery cells(except where no cells were detected in which case the returned value is 0): + +* table has one item for each detected cell: +* key (number) cell number (1 to number of cells) +* value (number) current cell voltage + +@status current Introduced in 2.8.0 + +### Parameters + +* `source` can be an index (number) (which was obtained by `getFieldInfo` or `getSourceIndex`) or a name (string) of the source. + +### Return value + +* `value` current source value (number), or last known telemetry item value. +* `isCurrent` is true for telemetry sources that are within the "Sensor Lost" duration and telemetry is streaming . Always true for non-telemetry items. +* `isFresh` is true for telemetry sources which have been recently updated and telemetry is streaming. Always true for non-telemetry items. + +#### Notice + +Getting a value by its numerical identifier is much faster than by its name. While `Cels` sensor returns current values of all cells in a table, a `Cels+` or `Cels-` will return a single value - the maximum or minimum Cels value. diff --git a/lua_api_reference/general/getswitchindex-positionname.md b/lua_api_reference/general/getswitchindex-positionname.md new file mode 100644 index 000000000..ab90b916d --- /dev/null +++ b/lua_api_reference/general/getswitchindex-positionname.md @@ -0,0 +1,11 @@ +# getSwitchIndex(positionName) + +@status current Introduced in 2.6 + +## Parameters + +* `positionName`: string naming a switch position as it is shown on radio menus where you can select a switch. Notice that many names have special characters in them like arrow up/down etc. (see [Special Character Constants](../constants/special-character-constants.md)). + +## Return value + +* value: integer. The switchIndex, which can be used as input for \`getSwitchName(switchIndex)\` and \`getSwitchValue(switchIndex)\`. Also corresponds to the fields in the table returned by \`model.getLogicalSwitch(switch)\` identifying switches. diff --git a/lua_api_reference/general/getswitchname-switchindex.md b/lua_api_reference/general/getswitchname-switchindex.md new file mode 100644 index 000000000..9aa2337f9 --- /dev/null +++ b/lua_api_reference/general/getswitchname-switchindex.md @@ -0,0 +1,11 @@ +# getSwitchName(switchIndex) + +@status current Introduced in 2.6 + +## Parameter + +* `switchIndex`: integer identifying a switch as returned by `getSwitchIndex(positionName)` or fields in the table returned by `model.getLogicalSwitch(switch)` identifying switches. + +## Return value + +* value: string naming the switch position as it is shown on radio menus where a switch can be chosen. diff --git a/lua_api_reference/general/getswitchvalue-switchindex.md b/lua_api_reference/general/getswitchvalue-switchindex.md new file mode 100644 index 000000000..188be9d4b --- /dev/null +++ b/lua_api_reference/general/getswitchvalue-switchindex.md @@ -0,0 +1,12 @@ +# getSwitchValue(switchIndex) + +@status current Introduced in 2.6 + +## Parameter + +* `switchIndex`: integer identifying a switch as returned by `getSwitchIndex(positionName)` or fields in the table returned by `model.getLogicalSwitch(switch)` identifying switches. + +## Return value + +* `value`: true/false. The value of the switch. + diff --git a/lua_api_reference/general/gettime.md b/lua_api_reference/general/gettime.md new file mode 100644 index 000000000..43dfb94dd --- /dev/null +++ b/lua_api_reference/general/gettime.md @@ -0,0 +1,18 @@ +# getTime\(\) + +Return the time since the radio was started in multiple of 10ms + +The timer internally uses a 32-bit counter which is enough for 497 days so overflows will not happen. + +@status current Introduced in 2.0.0 + +## Parameters + +none + +## Return value + +* `number` Number of 10ms ticks since the radio was started Example: + + run time: 12.54 seconds, return value: 1254 + diff --git a/lua_api_reference/general/gettxgps.md b/lua_api_reference/general/gettxgps.md new file mode 100644 index 000000000..001fdae0a --- /dev/null +++ b/lua_api_reference/general/gettxgps.md @@ -0,0 +1,22 @@ +# getTxGPS\(\) + +Return the internal GPS position or nil if no valid hardware found + +@status current Introduced in 2.2.2 + +## Parameters + +none + +## Return value + +* `table` representing the current radio position + * `lat` \(number\) internal GPS latitude, positive is North + * `lon` \(number\) internal GPS longitude, positive is East + * 'numsat' \(number\) current number of sats locked in by the GPS sensor + * 'fix' \(boolean\) fix status + * 'alt' \(number\) internal GPS altitude in 0.1m + * 'speed' \(number\) internal GPSspeed in 0.1m/s + * 'heading' \(number\) internal GPS ground course estimation in degrees \* 10 + * 'hdop' \(number\) internal GPS horizontal dilution of precision + diff --git a/lua_api_reference/general/getusage.md b/lua_api_reference/general/getusage.md new file mode 100644 index 000000000..d7d7018ea --- /dev/null +++ b/lua_api_reference/general/getusage.md @@ -0,0 +1,14 @@ +# getUsage\(\) + +Get percent of already used Lua instructions in current script execution cycle. + +@status current Introduced in 2.2.1 + +## Parameters + +none + +## Return value + +* `usage` \(number\) a value from 0 to 100 \(percent\) + diff --git a/lua_api_reference/general/getvalue.md b/lua_api_reference/general/getvalue.md new file mode 100644 index 000000000..885578d89 --- /dev/null +++ b/lua_api_reference/general/getvalue.md @@ -0,0 +1,48 @@ +# getValue\(source\) + +Returns the value of a source. + +The list of fixed sources: + +| OpenTX Version | Radio | +| :--- | :--- | +| 2.0 | [all](http://downloads-20.open-tx.org/firmware/lua_fields.txt) | +| 2.1 | [X9D and X9D+](http://downloads-21.open-tx.org/firmware/lua_fields_taranis.txt), [X9E](http://downloads-21.open-tx.org/firmware/lua_fields_taranis_x9e.txt) | +| 2.2 | [X9D and X9D+](http://downloads.open-tx.org/2.2/release/firmware/lua_fields_x9d.txt), [X9E](http://downloads.open-tx.org/2.2/release/firmware/lua_fields_x9e.txt), [Horus](http://downloads.open-tx.org/2.2/release/firmware/lua_fields_x12s.txt) | +| 2.3 | [X9D and X9D+](http://downloads.open-tx.org/2.3/release/firmware/lua_fields_x9d.txt), [X9E](http://downloads.open-tx.org/2.3/release/firmware/lua_fields_x9e.txt), [X7](http://downloads.open-tx.org/2.3/release/firmware/lua_fields_x7.txt), [Horus](http://downloads.open-tx.org/2.3/release/firmware/lua_fields_x12s.txt) | + +In OpenTX 2.1.x the telemetry sources no longer have a predefined name. To get a telemetry value simply use it's sensor name. For example: + +* Altitude sensor has a name "Alt" +* to get the current altitude use the source "Alt" +* to get the minimum altitude use the source "Alt-", to get the maximum use "Alt+" + +@status current Introduced in 2.0.0, changed in 2.1.0, `Cels+` and `Cels-` added in 2.1.9 + +## Parameters + +* `source` can be an identifier \(number\) \(which was obtained by the getFieldInfo\(\)\) + + or a name \(string\) of the source. + +## Return value + +* `value` current source value \(number\). Zero is returned for: + * non-existing sources + * for all telemetry source when the telemetry stream is not received + * far all non allowed sensors while FAI MODE is active +* `table` GPS position is returned in a table: + * `lat` \(number\) latitude, positive is North + * `lon` \(number\) longitude, positive is East + * `pilot-lat` \(number\) pilot latitude, positive is North + * `pilot-lon` \(number\) pilot longitude, positive is East +* `table` GPS date/time, see getDateTime\(\) +* `table` Cells are returned in a table \(except where no cells were detected in which case the returned value is 0\): + * table has one item for each detected cell: + * key \(number\) cell number \(1 to number of cells\) + * value \(number\) current cell voltage + +### Notice + +Getting a value by its numerical identifier is faster then by its name. While `Cels` sensor returns current values of all cells in a table, a `Cels+` or `Cels-` will return a single value - the maximum or minimum Cels value. + diff --git a/lua_api_reference/general/getversion.md b/lua_api_reference/general/getversion.md new file mode 100644 index 000000000..f4ad0d1c9 --- /dev/null +++ b/lua_api_reference/general/getversion.md @@ -0,0 +1,57 @@ +# getVersion\(\) + +Return OpenTX version + +@status current Introduced in 2.0.0, expanded in 2.1.7, radio type strings changed in 2.2.0, os name added in EdgeTX 2.4.0 + +## Example + +This example also runs in OpenTX versions where the function returned only one value: + +```lua +local function run(event) + local ver, radio, maj, minor, rev, osname = getVersion() + print("version: "..ver) + if radio then print ("radio: "..radio) end + if maj then print ("maj: "..maj) end + if minor then print ("minor: "..minor) end + if rev then print ("rev: "..rev) end + if osname then print ("osname: "..osname) end + return 1 +end + +return { run=run } +``` + +Output of the above script in simulator: + +```text +version: 2.4.0 +radio: tx16s-simu +maj: 2 +minor: 4 +rev: 0 +osname: EdgeTX +``` + +### Parameters + +none + +### Return value + +* `string` OpenTX version \(ie "2.1.5"\) +* `multiple` values \(available since 2.1.7\): + * \(string\) OpenTX version \(ie "2.1.5"\) + * \(string\) radio type: `x12s`, `x10`, `x9e`, `x9d+`, `x9d` or `x7`. + + If running in simulator the "-simu" is added + + * \(number\) major version \(ie 2 if version 2.1.5\) + * \(number\) minor version \(ie 1 if version 2.1.5\) + * \(number\) revision number \(ie 5 if version 2.1.5\) + + Since EdgeTX 2.4.0, sixth value added + + * \(string\) OS name \(i.e. EdgeTX or nil if OpenTX\) + diff --git a/lua_api_reference/general/ghosttelemetrypop.md b/lua_api_reference/general/ghosttelemetrypop.md new file mode 100644 index 000000000..ee64aef86 --- /dev/null +++ b/lua_api_reference/general/ghosttelemetrypop.md @@ -0,0 +1,16 @@ +# ghostTelemetryPop() + +Pops a received Ghost Telemetry packet from the queue. + +@status current Introduced in 2.7.0 + +**Parameters** + +none + +**Return value** + +* `nil` queue does not contain any (or enough) bytes to form a whole packet +* `multiple` returns 2 values: +* type (number) +* packet (table) data bytes diff --git a/lua_api_reference/general/ghosttelemetrypush.md b/lua_api_reference/general/ghosttelemetrypush.md new file mode 100644 index 000000000..56fcbcec9 --- /dev/null +++ b/lua_api_reference/general/ghosttelemetrypush.md @@ -0,0 +1,17 @@ +# ghostTelemetryPush() + +This functions allows for sending telemetry data toward the Ghost link. + +When called without parameters, it will only return the status of the output buffer without sending anything. + +@status current Introduced in 2.7.0 + +**Parameters** + +* `command` command +* `data` table of data bytes + +**Return value** + +* `boolean` data queued in output buffer or not. +* `nil` incorrect telemetry protocol. diff --git a/lua_api_reference/general/grey.md b/lua_api_reference/general/grey.md new file mode 100644 index 000000000..936ac3f37 --- /dev/null +++ b/lua_api_reference/general/grey.md @@ -0,0 +1,18 @@ +# GREY\(\) + +Returns gray value which can be used in LCD functions + +@status current Introduced in 2.0.13 + +## Parameters + +none + +## Return value + +* `(number)` a value that represents amount of _greyness_ \(from 0 to 15\) + +### Notice + +Only available on Taranis + diff --git a/lua_api_reference/general/killevents.md b/lua_api_reference/general/killevents.md new file mode 100644 index 000000000..b1dc9d01d --- /dev/null +++ b/lua_api_reference/general/killevents.md @@ -0,0 +1,14 @@ +# killEvents\(key\) + +Stops key state machine. See [Key Events](https://github.com/EdgeTX/lua-reference-guide/tree/fe42fe461fcccd828fba5d218da01336e4f7b0cd/part_iii_-_opentx_lua_api_reference/key_events.md) for the detailed description. + +@status current Introduced in 2.0.0 + +## Parameters + +* `key` \(number\) key to be killed, can also include event type \(only the key part is used\) + +## Return value + +none + diff --git a/lua_api_reference/general/loadscript.md b/lua_api_reference/general/loadscript.md new file mode 100644 index 000000000..c36f755c0 --- /dev/null +++ b/lua_api_reference/general/loadscript.md @@ -0,0 +1,49 @@ +# loadScript\(file \[, mode\], \[,env\]\) + +Load a Lua script file. This is similar to Lua's own [loadfile\(\)](https://www.lua.org/manual/5.2/manual.html#pdf-loadfile) API method, but it uses OpenTx's optional pre-compilation feature to save memory and time during load. + +Return values are same as from Lua API loadfile\(\) method: If the script was loaded w/out errors then the loaded script \(or "chunk"\) is returned as a function. Otherwise, returns nil plus the error message. + +@status current Introduced in 2.2.0 + +## Example + +```lua + fun, err = loadScript("/SCRIPTS/FUNCTIONS/print.lua") + if (fun ~= nil) then + fun("Hello from loadScript()") + else + print(err) + end +``` + +### Parameters + +* `file` \(string\) Full path and file name of script. The file extension is optional and ignored \(see `mode` param to control which extension will be used\). However, if an extension is specified, it should be ".lua" \(or ".luac"\), otherwise it is treated as part of the file name and the .lua/.luac will be appended to that. +* `mode` \(string\) \(optional\) Controls whether to force loading the text \(.lua\) or pre-compiled binary \(.luac\) version of the script. By default OTx will load the newest version and compile a new binary if necessary \(overwriting any existing .luac version of the same script, and stripping some debug info like line numbers\). You can use `mode` to control the loading behavior more specifically. Possible values are: + * `b` only binary. + * `t` only text. + * `T` \(default on simulator\) prefer text but load binary if that is the only version available. + * `bt` \(default on radio\) either binary or text, whichever is newer \(binary preferred when timestamps are equal\). + * Add `x` to avoid automatic compilation of source file to .luac version. + + Eg: "tx", "bx", or "btx". + + * Add `c` to force compilation of source file to .luac version \(even if existing version is newer than source file\). + + Eg: "tc" or "btc" \(forces "t", overrides "x"\). + + * Add `d` to keep extra debug info in the compiled binary. + + Eg: "td", "btd", or "tcd" \(no effect with just "b" or with "x"\). +* `env` \(integer\) See documentation for Lua function loadfile\(\). + +### Return value + +* `function` The loaded script, or `nil` if there was an error \(e.g. file not found or syntax error\). +* `string` Error message\(s\), if any. Blank if no error occurred. + +#### Notice + +Note that you will get an error if you specify `mode` as "b" or "t" and that specific version of the file does not exist \(eg. no .luac file when "b" is used\). Also note that `mode` is NOT passed on to Lua's loader function, so unlike with loadfile\(\) the actual file content is not checked \(as if no mode or "bt" were passed to loadfile\(\)\). + diff --git a/lua_api_reference/general/multibuffer.md b/lua_api_reference/general/multibuffer.md new file mode 100644 index 000000000..6f911ebd3 --- /dev/null +++ b/lua_api_reference/general/multibuffer.md @@ -0,0 +1,16 @@ +# multiBuffer\(address\[,value\]\) + +This function reads/writes the Multi protocol buffer to interact with a protocol². + +@status current Introduced in 2.3.2 + +## Parameters + +* `address` to read/write in the buffer + + @param \(optional\): value to write in the buffer + +## Return value + +* `buffer` value \(number\) + diff --git a/lua_api_reference/general/playduration.md b/lua_api_reference/general/playduration.md new file mode 100644 index 000000000..275150d5a --- /dev/null +++ b/lua_api_reference/general/playduration.md @@ -0,0 +1,17 @@ +# playDuration\(duration \[, hourFormat\]\) + +Play a time value \(text to speech\) + +@status current Introduced in 2.1.0 + +## Parameters + +* `duration` \(number\) number of seconds to play. Only integral part is used. +* `hourFormat` \(number\): + * `0 or not present` play format: minutes and seconds. + * `!= 0` play format: hours, minutes and seconds. + +## Return value + +none + diff --git a/lua_api_reference/general/playfile.md b/lua_api_reference/general/playfile.md new file mode 100644 index 000000000..77e24c78f --- /dev/null +++ b/lua_api_reference/general/playfile.md @@ -0,0 +1,18 @@ +# playFile\(name\) + +Play a file from the SD card + +@status current Introduced in 2.0.0, changed in 2.1.0 + +## Parameters + +* `path` \(string\) full path to wav file \(i.e. “/SOUNDS/en/system/tada.wav”\) + + Introduced in 2.1.0: If you use a relative path, the current language is appended + + to the path \(example: for English language: `/SOUNDS/en` is appended\) + +## Return value + +none + diff --git a/lua_api_reference/general/playhaptic.md b/lua_api_reference/general/playhaptic.md new file mode 100644 index 000000000..57c1f75b8 --- /dev/null +++ b/lua_api_reference/general/playhaptic.md @@ -0,0 +1,18 @@ +# playHaptic\(duration, pause \[, flags\]\) + +Generate haptic feedback + +@status current Introduced in 2.2.0 + +## Parameters + +* `duration` \(number\) length of the haptic feedback in milliseconds +* `pause` \(number\) length of the silence after haptic feedback in milliseconds +* `flags` \(number\): + * `0 or not present` play with normal priority + * `PLAY_NOW` play immediately + +## Return value + +none + diff --git a/lua_api_reference/general/playnumber.md b/lua_api_reference/general/playnumber.md new file mode 100644 index 000000000..4e160e3ad --- /dev/null +++ b/lua_api_reference/general/playnumber.md @@ -0,0 +1,19 @@ +# playNumber\(value, unit \[, attributes\]\) + +Play a numerical value \(text to speech\) + +@status current Introduced in 2.0.0 + +## Parameters + +* `value` \(number\) number to play. Value is interpreted as integer. +* `unit` \(number\) unit identifier \[Full list\]\(\(../appendix/units.html\)\) +* `attributes` \(unsigned number\) possible values: + * `0 or not present` plays integral part of the number \(for a number 123 it plays 123\) + * `PREC1` plays a number with one decimal place \(for a number 123 it plays 12.3\) + * `PREC2` plays a number with two decimal places \(for a number 123 it plays 1.23\) + +## Return value + +none + diff --git a/lua_api_reference/general/playtone.md b/lua_api_reference/general/playtone.md new file mode 100644 index 000000000..8d611c4a3 --- /dev/null +++ b/lua_api_reference/general/playtone.md @@ -0,0 +1,21 @@ +# playTone\(frequency, duration, pause \[, flags \[, freqIncr\]\]\) + +Play a tone + +@status current Introduced in 2.1.0 + +## Parameters + +* `frequency` \(number\) tone frequency in Hz \(from 150 to 15000\) +* `duration` \(number\) length of the tone in milliseconds +* `pause` \(number\) length of the silence after the tone in milliseconds +* `flags` \(number\): + * `0 or not present` play with normal priority. + * `PLAY_BACKGROUND` play in background \(built in vario function uses this context\) + * `PLAY_NOW` play immediately +* `freqIncr` \(number\) positive number increases the tone pitch \(frequency with time\), negative number decreases it. The frequency changes every 10 milliseconds, the change is `freqIncr * 10Hz`. The valid range is from -127 to 127. + +## Return value + +none + diff --git a/lua_api_reference/general/popupconfirmation-title-message-event.md b/lua_api_reference/general/popupconfirmation-title-message-event.md new file mode 100644 index 000000000..9ab3ef8bb --- /dev/null +++ b/lua_api_reference/general/popupconfirmation-title-message-event.md @@ -0,0 +1,20 @@ +# popupConfirmation\(title, message, event\) + +Raises a pop-up on screen that asks for confirmation + +@status current Introduced in 2.2.0, changed from \(title, event\) to \(title, message, event\) in 2.3.8 + +## Parameters + +* `title` \(string\) title to display +* `message` \(string\) text to display +* `event` \(number\) the event variable that is passed in from the Run function \(key pressed\) + +## Return value + +* `"CANCEL"` user pushed EXIT key + +### Notice + +Use only from stand-alone and telemetry scripts. + diff --git a/lua_api_reference/general/popupconfirmation.md b/lua_api_reference/general/popupconfirmation.md new file mode 100644 index 000000000..9ab3ef8bb --- /dev/null +++ b/lua_api_reference/general/popupconfirmation.md @@ -0,0 +1,20 @@ +# popupConfirmation\(title, message, event\) + +Raises a pop-up on screen that asks for confirmation + +@status current Introduced in 2.2.0, changed from \(title, event\) to \(title, message, event\) in 2.3.8 + +## Parameters + +* `title` \(string\) title to display +* `message` \(string\) text to display +* `event` \(number\) the event variable that is passed in from the Run function \(key pressed\) + +## Return value + +* `"CANCEL"` user pushed EXIT key + +### Notice + +Use only from stand-alone and telemetry scripts. + diff --git a/lua_api_reference/general/popupinput.md b/lua_api_reference/general/popupinput.md new file mode 100644 index 000000000..f0de646be --- /dev/null +++ b/lua_api_reference/general/popupinput.md @@ -0,0 +1,24 @@ +# popupInput\(title, event, input, min, max\) + +Raises a pop-up on screen that allows uses input + +@status current Introduced in 2.0.0 + +## Parameters + +* `title` \(string\) text to display +* `event` \(number\) the event variable that is passed in from the Run function \(key pressed\) +* `input` \(number\) value that can be adjusted by the +/­- keys +* `min` \(number\) min value that input can reach \(by pressing the -­ key\) +* `max` \(number\) max value that input can reach + +## Return value + +* `number` result of the input adjustment +* `"OK"` user pushed ENT key +* `"CANCEL"` user pushed EXIT key + +### Notice + +Use only from stand-alone and telemetry scripts. + diff --git a/lua_api_reference/general/popupwarning.md b/lua_api_reference/general/popupwarning.md new file mode 100644 index 000000000..8b8860248 --- /dev/null +++ b/lua_api_reference/general/popupwarning.md @@ -0,0 +1,19 @@ +# popupWarning\(title, event\) + +Raises a pop-up on screen that shows a warning + +@status current Introduced in 2.2.0 + +## Parameters + +* `title` \(string\) text to display +* `event` \(number\) the event variable that is passed in from the Run function \(key pressed\) + +## Return value + +* `"CANCEL"` user pushed EXIT key + +### Notice + +Use only from stand-alone and telemetry scripts. + diff --git a/lua_api_reference/general/resetglobaltimer.md b/lua_api_reference/general/resetglobaltimer.md new file mode 100644 index 000000000..ebc6802fc --- /dev/null +++ b/lua_api_reference/general/resetglobaltimer.md @@ -0,0 +1,20 @@ +# resetGlobalTimer\(\[type\]\) + +Resets the radio global timer to 0. + +@status current Introduced in 2.2.2, param added in 2.3 + +## Parameters + +* `(optional)` : if set to 'all', throttle ,throttle percent and session timers are reset too + + ```text + if set to 'session', radio session timer is reset too + if set to 'ttimer', radio throttle timer is reset too + if set to 'tptimer', radio throttle percent timer is reset too + ``` + +## Return value + +none + diff --git a/lua_api_reference/general/serialgetpower-port_nr.md b/lua_api_reference/general/serialgetpower-port_nr.md new file mode 100644 index 000000000..8745856c2 --- /dev/null +++ b/lua_api_reference/general/serialgetpower-port_nr.md @@ -0,0 +1,14 @@ +# serialGetPower(port\_nr) + +@status current Introduced in 2.9.0 + +### Parameters + +* `port_nr:` valid values are only 0 and 1 on radios that have SWSERIALPOWER defined + * 0 - first serial port, e.g. on TX16S AUX1 + * 1 - second serial port, e.g. on TX16S AUX2 + +### Return value + +* `value:` true for power enabled, false for power disabled. +* `nil` serial port power control not available diff --git a/lua_api_reference/general/serialread.md b/lua_api_reference/general/serialread.md new file mode 100644 index 000000000..49b30da95 --- /dev/null +++ b/lua_api_reference/general/serialread.md @@ -0,0 +1,16 @@ +# serialRead\(\[num\]\) + +@param num \(optional\): maximum number of bytes to read. If non-zero, serialRead will read up to num characters from the buffer. If 0 or left out, serialRead will read up to and including the first newline character or the end of the buffer. Note that the returned string may not end in a newline if this character is not present in the buffer. + +Reads characters from the serial port. The string is allowed to contain any character, including 0. + +@status current Introduced in 2.3.8 + +## Parameters + +none + +## Return value + +* `str` string. Empty if no new characters were available. + diff --git a/lua_api_reference/general/serialsetpower-port_nr-value.md b/lua_api_reference/general/serialsetpower-port_nr-value.md new file mode 100644 index 000000000..6af712a3d --- /dev/null +++ b/lua_api_reference/general/serialsetpower-port_nr-value.md @@ -0,0 +1,16 @@ +# serialSetPower(port\_nr, value) + +@status current Introduced in 2.9.0 + +### Parameters + +* `port_nr:` valid values are only 0 and 1 on radios that have SWSERIALPOWER defined + * 0 - first serial port, e.g. on TX16S AUX1 + * 1 - second serial port, e.g. on TX16S AUX2 +* `value:` + * 0 - disable power + * 1 - enable power + +### Return value + +* `success:` true/false diff --git a/lua_api_reference/general/serialwrite.md b/lua_api_reference/general/serialwrite.md new file mode 100644 index 000000000..134105022 --- /dev/null +++ b/lua_api_reference/general/serialwrite.md @@ -0,0 +1,16 @@ +# serialWrite\(str\) + +@param str \(string\) String to be written to the serial port. + +Writes a string to the serial port. The string is allowed to contain any character, including 0. + +@status current Introduced in 2.3.10 + +## Parameters + +none + +## Return value + +none + diff --git a/lua_api_reference/general/setserialbaudrate-baudrate.md b/lua_api_reference/general/setserialbaudrate-baudrate.md new file mode 100644 index 000000000..4f0835542 --- /dev/null +++ b/lua_api_reference/general/setserialbaudrate-baudrate.md @@ -0,0 +1,14 @@ +# setSerialBaudrate\(baudrate\) + +Set baudrate for serial port\(s\) affected to LUA + +@status current Introduced in 2.3.12 + +## Parameters + +`baudrate` Desired baudrate + +## Return value + +none + diff --git a/lua_api_reference/general/setserialbaudrate.md b/lua_api_reference/general/setserialbaudrate.md new file mode 100644 index 000000000..4f0835542 --- /dev/null +++ b/lua_api_reference/general/setserialbaudrate.md @@ -0,0 +1,14 @@ +# setSerialBaudrate\(baudrate\) + +Set baudrate for serial port\(s\) affected to LUA + +@status current Introduced in 2.3.12 + +## Parameters + +`baudrate` Desired baudrate + +## Return value + +none + diff --git a/lua_api_reference/general/setshmvar-id-value.md b/lua_api_reference/general/setshmvar-id-value.md new file mode 100644 index 000000000..ccc19608a --- /dev/null +++ b/lua_api_reference/general/setshmvar-id-value.md @@ -0,0 +1,18 @@ +# setShmVar(id, value) + +Sets the value of a shared memory variable that can be used for passing data between Lua widgets and other Lua scripts. + +@status current Introduced in 2.6 + +**Parameters** + +* `id:` integer between 1 and 16 identifying the shared memory variable. +* `value:` integer. The value of the shared memory variable. + +**Return value** + +none + +**Notice** + +Only available on radios with color display diff --git a/lua_api_reference/general/setstickyswitch-id-value.md b/lua_api_reference/general/setstickyswitch-id-value.md new file mode 100644 index 000000000..36d43fa68 --- /dev/null +++ b/lua_api_reference/general/setstickyswitch-id-value.md @@ -0,0 +1,15 @@ +# setStickySwitch(id, value) + +Sets the value of a sticky logical switch. + +@status current Introduced in 2.6 + +## Parameters + +* id: integer identifying the sticky logical switch (zero for LS1 etc.). +* value: true/false. The new value of the sticky logical switch. + +## Return value + +* bufferFull: true/false. This function sends a message from Lua to the logical switch processor via a buffer with eight slots that are read 10 times per second. If the buffer is full, then a true value is returned, and no message was sent (i.e. the switch was not changed). + diff --git a/lua_api_reference/general/settelemetryvalue.md b/lua_api_reference/general/settelemetryvalue.md new file mode 100644 index 000000000..36c99f27e --- /dev/null +++ b/lua_api_reference/general/settelemetryvalue.md @@ -0,0 +1,25 @@ +# setTelemetryValue(id, subID, instance, value \[, unit \[, precision \[, name]]]) + +@status current Introduced in 2.2.0 + +## Parameters + +* `id` Id of the sensor, valid range is from 0 to 0xFFFF +* `subID` subID of the sensor, usually 0, valid range is from 0 to 7 +* `instance` instance of the sensor (SensorID), valid range is from 0 to 0xFF +* `value` fed to the sensor +* `unit` unit of the sensor [Full list](https://luadoc.edgetx.org/appendix/units.html) +* `precision` the precision of the sensor + * `0 or not present` no decimal precision. + * `!= 0` value is divided by 10^precision, e.g. value=1000, prec=2 => 10.00. +* `name` (string) Name of the sensor if it does not yet exist (4 chars). + * `not present` Name defaults to the Id. + * `present` Sensor takes name of the argument. Argument must have name surrounded by quotes: e.g., "Name" + +## Return value + +* `true,` if the sensor was just added. In this case the value is ignored (subsequent call will set the value) + +### Notice + +All three parameters `id`, `subID` and `instance` can't be zero at the same time. At least one of them must be different from zero. diff --git a/lua_api_reference/general/sources-first-last.md b/lua_api_reference/general/sources-first-last.md new file mode 100644 index 000000000..13ed1e93c --- /dev/null +++ b/lua_api_reference/general/sources-first-last.md @@ -0,0 +1,16 @@ +# sources(\[first\[, last]]) + +This is an iterator function over value sources. + +`for sourceIndex, sourceName in sources() do ...` + +will iterate over all available value sources. + +### Parameters + +* `first`: the first source index. If `nil` or omitted, the first available source is used. +* `last`: the last soure index. If `nil` or omitted, the last available source is used. + +### Status + +current Introduced in 2.6 diff --git a/lua_api_reference/general/sporttelemetrypop.md b/lua_api_reference/general/sporttelemetrypop.md new file mode 100644 index 000000000..a112e66cb --- /dev/null +++ b/lua_api_reference/general/sporttelemetrypop.md @@ -0,0 +1,19 @@ +# sportTelemetryPop\(\) + +Pops a received SPORT packet from the queue. Please note that only packets using a data ID within 0x5000 to 0x50FF \(frame ID == 0x10\), as well as packets with a frame ID equal 0x32 \(regardless of the data ID\) will be passed to the LUA telemetry receive queue. + +@status current Introduced in 2.2.0 + +## Parameters + +none + +## Return value + +* `nil` queue does not contain any \(or enough\) bytes to form a whole packet +* `multiple` returns 4 values: + * sensor ID \(number\) + * frame ID \(number\) + * data ID \(number\) + * value \(number\) + diff --git a/lua_api_reference/general/sporttelemetrypush.md b/lua_api_reference/general/sporttelemetrypush.md new file mode 100644 index 000000000..07c718a17 --- /dev/null +++ b/lua_api_reference/general/sporttelemetrypush.md @@ -0,0 +1,20 @@ +# sportTelemetryPush\(\) + +This functions allows for sending SPORT telemetry data toward the receiver, and more generally, to anything connected SPORT bus on the receiver or transmitter. + +When called without parameters, it will only return the status of the output buffer without sending anything. + +@status current Introduced in 2.2.0, retval nil added in 2.3.4 + +## Parameters + +* `sensorId` physical sensor ID +* `frameId` frame ID +* `dataId` data ID +* `value` value + +## Return value + +* `boolean` data queued in output buffer or not. +* `nil` incorrect telemetry protocol. + diff --git a/lua_api_reference/general/switches-first-last.md b/lua_api_reference/general/switches-first-last.md new file mode 100644 index 000000000..43c408584 --- /dev/null +++ b/lua_api_reference/general/switches-first-last.md @@ -0,0 +1,16 @@ +# switches(\[first\[, last]]) + +This is an iterator function over switch positions. + +`for switchIndex, switchName in switches() do ...` + +will iterate over all available switch positions. + +### Parameters + +* `first`: the first switch index. If `nil` or omitted, the first available switch is used. +* `last`: the last switch index. If `nil` or omitted, the last available switch is used. + +### Status + +Current Introduced in 2.6 diff --git a/lua_api_reference/lcd/README.md b/lua_api_reference/lcd/README.md new file mode 100644 index 000000000..7dcb769ba --- /dev/null +++ b/lua_api_reference/lcd/README.md @@ -0,0 +1,2 @@ +# Lcd Functions + diff --git a/lua_api_reference/lcd/RGB.md b/lua_api_reference/lcd/RGB.md new file mode 100644 index 000000000..18e8dae9a --- /dev/null +++ b/lua_api_reference/lcd/RGB.md @@ -0,0 +1,31 @@ + + +## lcd.RGB(r, g, b) + + + +Returns a 5/6/5 rgb color code, that can be used with lcd.setColor + +@status current Introduced in 2.2.0 + + +#### Parameters + +* `r` (integer) a number between 0x00 and 0xff that expresses te amount of red in the color + +* `g` (integer) a number between 0x00 and 0xff that expresses te amount of green in the color + +* `b` (integer) a number between 0x00 and 0xff that expresses te amount of blue in the color + + + +#### Return value + +* `number` (integer) rgb color expressed in 5/6/5 format + + + +##### Notice +Only available on Colorlcd radios + + diff --git a/lua_api_reference/lcd/clear.md b/lua_api_reference/lcd/clear.md new file mode 100644 index 000000000..3819ca5c1 --- /dev/null +++ b/lua_api_reference/lcd/clear.md @@ -0,0 +1,25 @@ + + +## lcd.clear([color]) + + + +Clear the LCD screen + +@status current Introduced in 2.0.0, `color` parameter introduced in 2.2.0 RC12 + + +#### Parameters + +* `color` (optional, only on color screens) + + + +#### Return value + +none + +##### Notice +This function only works in stand-alone and telemetry scripts. + + diff --git a/lua_api_reference/lcd/drawBitmap.md b/lua_api_reference/lcd/drawBitmap.md new file mode 100644 index 000000000..adf4fbc61 --- /dev/null +++ b/lua_api_reference/lcd/drawBitmap.md @@ -0,0 +1,30 @@ + + +## lcd.drawBitmap(bitmap, x, y [, scale]) + + + +Displays a bitmap at (x,y) + +@status current Introduced in 2.2.0 + + +#### Parameters + +* `bitmap` (pointer) point to a bitmap previously opened with Bitmap.open() + +* `x,y` (positive numbers) starting coordinates + +* `scale` (positive numbers) scale in %, 50 divides size by two, 100 is unchanged, 200 doubles size. +Omitting scale draws image in 1:1 scale and is faster than specifying 100 for scale. + + + +#### Return value + +none + +##### Notice +Only available on Horus + + diff --git a/lua_api_reference/lcd/drawChannel.md b/lua_api_reference/lcd/drawChannel.md new file mode 100644 index 000000000..e52518677 --- /dev/null +++ b/lua_api_reference/lcd/drawChannel.md @@ -0,0 +1,26 @@ + + +## lcd.drawChannel(x, y, source, flags) + + + +Display a telemetry value at (x,y) + +@status current Introduced in 2.0.6, changed in 2.1.0 (only telemetry sources are valid) + + +#### Parameters + +* `x,y` (positive numbers) starting coordinate + +* `source` can be a source identifier (number) or a source name (string). +See getValue() + +* `flags` (unsigned number) drawing flags + + + +#### Return value + +none + diff --git a/lua_api_reference/lcd/drawCombobox.md b/lua_api_reference/lcd/drawCombobox.md new file mode 100644 index 000000000..2c8814a50 --- /dev/null +++ b/lua_api_reference/lcd/drawCombobox.md @@ -0,0 +1,36 @@ + + +## lcd.drawCombobox(x, y, w, list, idx [, flags]) + + + +Draw a combo box + +@status current Introduced in 2.0.0 + + +#### Parameters + +* `x,y` (positive numbers) top left corner position + +* `w` (number) width of combo box in pixels + +* `list` (table) combo box elements, each element is a string + +* `idx` (integer) index of entry to highlight + +* `flags` (unsigned number) drawing flags, the flags can not be combined: + * `BLINK` combo box is expanded + * `INVERS` combo box collapsed, text inversed + * `0 or not present` combo box collapsed, text normal + + + +#### Return value + +none + +##### Notice +Only available on Taranis + + diff --git a/lua_api_reference/lcd/drawFilledRectangle.md b/lua_api_reference/lcd/drawFilledRectangle.md new file mode 100644 index 000000000..977bcdbf4 --- /dev/null +++ b/lua_api_reference/lcd/drawFilledRectangle.md @@ -0,0 +1,27 @@ + + +## lcd.drawFilledRectangle(x, y, w, h [, flags]) + + + +Draw a solid rectangle from top left corner (x,y) of specified width and height + +@status current Introduced in 2.0.0 + + +#### Parameters + +* `x,y` (positive numbers) top left corner position + +* `w` (number) width in pixels + +* `h` (number) height in pixels + +* `flags` (unsigned number) drawing flags + + + +#### Return value + +none + diff --git a/lua_api_reference/lcd/drawGauge.md b/lua_api_reference/lcd/drawGauge.md new file mode 100644 index 000000000..30c15eb5d --- /dev/null +++ b/lua_api_reference/lcd/drawGauge.md @@ -0,0 +1,31 @@ + + +## lcd.drawGauge(x, y, w, h, fill, maxfill [, flags]) + + + +Draw a simple gauge that is filled based upon fill value + +@status current Introduced in 2.0.0, changed in 2.2.0 + + +#### Parameters + +* `x,y` (positive numbers) top left corner position + +* `w` (number) width in pixels + +* `h` (number) height in pixels + +* `fill` (number) amount of fill to apply + +* `maxfill` (number) total value of fill + +* `flags` (unsigned number) drawing flags + + + +#### Return value + +none + diff --git a/lua_api_reference/lcd/drawLine.md b/lua_api_reference/lcd/drawLine.md new file mode 100644 index 000000000..389f83d33 --- /dev/null +++ b/lua_api_reference/lcd/drawLine.md @@ -0,0 +1,32 @@ + + +## lcd.drawLine(x1, y1, x2, y2, pattern, flags) + + + +Draw a straight line on LCD + +@status current Introduced in 2.0.0, flags introduced in 2.3.6 + + +#### Parameters + +* `x1,y1` (positive numbers) starting coordinate + +* `x2,y2` (positive numbers) end coordinate + +* `pattern` SOLID or DOTTED + +* `flags` lcdflags + + + +#### Return value + +none + +##### Notice +If the start or the end of the line is outside the LCD dimensions, then the +whole line will not be drawn (starting from OpenTX 2.1.5) + + diff --git a/lua_api_reference/lcd/drawNumber.md b/lua_api_reference/lcd/drawNumber.md new file mode 100644 index 000000000..4663035bb --- /dev/null +++ b/lua_api_reference/lcd/drawNumber.md @@ -0,0 +1,30 @@ + + +## lcd.drawNumber(x, y, value [, flags]) + + + +Display a number at (x,y) + +@status current Introduced in 2.0.0, `SHADOWED` introduced in 2.2.1 + + +#### Parameters + +* `x,y` (positive numbers) starting coordinate + +* `value` (number) value to display + +* `flags` (unsigned number) drawing flags: + * `0 or not specified` display with no decimal (like abs()) + * `PREC1` display with one decimal place (number 386 is displayed as 38.6) + * `PREC2` display with tow decimal places (number 386 is displayed as 3.86) + * other general LCD flag also apply + * `SHADOWED` Horus only, apply a shadow effect + + + +#### Return value + +none + diff --git a/lua_api_reference/lcd/drawPixmap.md b/lua_api_reference/lcd/drawPixmap.md new file mode 100644 index 000000000..93ee19e35 --- /dev/null +++ b/lua_api_reference/lcd/drawPixmap.md @@ -0,0 +1,27 @@ + + +## lcd.drawPixmap(x, y, name) + + + +Draw a bitmap at (x,y) + +@status current Introduced in 2.0.0 + + +#### Parameters + +* `x,y` (positive numbers) starting coordinates + +* `name` (string) full path to the bitmap on SD card (i.e. “/IMAGES/test.bmp”) + + + +#### Return value + +none + +##### Notice +Maximum image size is [display width / 2] x [display height] pixels. + + diff --git a/lua_api_reference/lcd/drawPoint.md b/lua_api_reference/lcd/drawPoint.md new file mode 100644 index 000000000..2ca9d40e8 --- /dev/null +++ b/lua_api_reference/lcd/drawPoint.md @@ -0,0 +1,31 @@ + + +## lcd.drawPoint(x, y) + + + +Draw a single pixel at (x,y) position + +@status current Introduced in 2.0.0 + + +#### Parameters + +* `x` (positive number) x position + +* `y` (positive number) y position + +* `flags` (optional) lcdflags + + + +#### Return value + +none + +##### Notice +Taranis has an LCD display width of 212 pixels and height of 64 pixels. +Position (0,0) is at top left. Y axis is negative, top line is 0, +bottom line is 63. Drawing on an existing black pixel produces white pixel (TODO check this!) + + diff --git a/lua_api_reference/lcd/drawRectangle.md b/lua_api_reference/lcd/drawRectangle.md new file mode 100644 index 000000000..cfe87402a --- /dev/null +++ b/lua_api_reference/lcd/drawRectangle.md @@ -0,0 +1,29 @@ + + +## lcd.drawRectangle(x, y, w, h [, flags [, t]]) + + + +Draw a rectangle from top left corner (x,y) of specified width and height + +@status current Introduced in 2.0.0, changed in 2.2.0 + + +#### Parameters + +* `x,y` (positive numbers) top left corner position + +* `w` (number) width in pixels + +* `h` (number) height in pixels + +* `flags` (unsigned number) drawing flags + +* `t` (number) thickness in pixels, defaults to 1 (only on Horus) + + + +#### Return value + +none + diff --git a/lua_api_reference/lcd/drawScreenTitle.md b/lua_api_reference/lcd/drawScreenTitle.md new file mode 100644 index 000000000..b54e39a8a --- /dev/null +++ b/lua_api_reference/lcd/drawScreenTitle.md @@ -0,0 +1,30 @@ + + +## lcd.drawScreenTitle(title, page, pages) + + + +Draw a title bar + +@status current Introduced in 2.0.0 + + +#### Parameters + +* `title` (string) text for the title + +* `page` (number) page number + +* `pages` (number) total number of pages. Only used as indicator on +the right side of title bar. (i.e. idx=2, cnt=5, display `2/5`) + + + +#### Return value + +none + +##### Notice +Only available on Taranis + + diff --git a/lua_api_reference/lcd/drawSource.md b/lua_api_reference/lcd/drawSource.md new file mode 100644 index 000000000..6b5ad53d7 --- /dev/null +++ b/lua_api_reference/lcd/drawSource.md @@ -0,0 +1,25 @@ + + +## lcd.drawSource(x, y, source [, flags]) + + + +Displays the name of the corresponding input as defined by the source at (x,y) + +@status current Introduced in 2.0.0 + + +#### Parameters + +* `x,y` (positive numbers) starting coordinate + +* `source` (number) source index + +* `flags` (unsigned number) drawing flags + + + +#### Return value + +none + diff --git a/lua_api_reference/lcd/drawSwitch.md b/lua_api_reference/lcd/drawSwitch.md new file mode 100644 index 000000000..83582fac4 --- /dev/null +++ b/lua_api_reference/lcd/drawSwitch.md @@ -0,0 +1,26 @@ + + +## lcd.drawSwitch(x, y, switch, flags) + + + +Draw a text representation of switch at (x,y) + +@status current Introduced in 2.0.0 + + +#### Parameters + +* `x,y` (positive numbers) starting coordinate + +* `switch` (number) number of switch to display, negative number +displays negated switch + +* `flags` (unsigned number) drawing flags, only SMLSIZE, BLINK and INVERS. + + + +#### Return value + +none + diff --git a/lua_api_reference/lcd/drawText.md b/lua_api_reference/lcd/drawText.md new file mode 100644 index 000000000..86a2f873e --- /dev/null +++ b/lua_api_reference/lcd/drawText.md @@ -0,0 +1,35 @@ + + +## lcd.drawText(x, y, text [, flags]) + + + +Draw a text beginning at (x,y) + +@status current Introduced in 2.0.0, `SHADOWED` introduced in 2.2.1 + + +#### Parameters + +* `x,y` (positive numbers) starting coordinate + +* `text` (string) text to display + +* `flags` (unsigned number) drawing flags. All values can be +combined together using the + character. ie BLINK + DBLSIZE. +See the [Appendix](../appendix/fonts.md) for available characters in each font set. + * `0 or not specified` normal font + * `XXLSIZE` jumbo sized font + * `DBLSIZE` double size font + * `MIDSIZE` mid sized font + * `SMLSIZE` small font + * `INVERS` inverted display + * `BLINK` blinking text + * `SHADOWED` Horus only, apply a shadow effect + + + +#### Return value + +none + diff --git a/lua_api_reference/lcd/drawTimer.md b/lua_api_reference/lcd/drawTimer.md new file mode 100644 index 000000000..a416208b6 --- /dev/null +++ b/lua_api_reference/lcd/drawTimer.md @@ -0,0 +1,29 @@ + + +## lcd.drawTimer(x, y, value [, flags]) + + + +Display a value formatted as time at (x,y) + +@status current Introduced in 2.0.0, `SHADOWED` introduced in 2.2.1 + + +#### Parameters + +* `x,y` (positive numbers) starting coordinate + +* `value` (number) time in seconds + +* `flags` (unsigned number) drawing flags: + * `0 or not specified` normal representation (minutes and seconds) + * `TIMEHOUR` display hours + * other general LCD flag also apply + * `SHADOWED` Horus only, apply a shadow effect + + + +#### Return value + +none + diff --git a/lua_api_reference/lcd/drawannulus.md b/lua_api_reference/lcd/drawannulus.md new file mode 100644 index 000000000..2e50483fe --- /dev/null +++ b/lua_api_reference/lcd/drawannulus.md @@ -0,0 +1,17 @@ +# lcd.drawAnnulus\(x, y, r1, r2, start, end \[, flags\]\) + +Draw an arc + +@status current Introduced in 2.4.0 + +## Parameters + +* `x,y` \(positive numbers\) coordinates of the center +* `r1,r2` \(positive numbers\) radii of the inside and outside of the annulus +* `start,end` \(positive numbers\) start and end of the annulus +* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants + +## Return value + +none + diff --git a/lua_api_reference/lcd/drawarc.md b/lua_api_reference/lcd/drawarc.md new file mode 100644 index 000000000..95399131e --- /dev/null +++ b/lua_api_reference/lcd/drawarc.md @@ -0,0 +1,17 @@ +# lcd.drawArc\(x, y, r, start, end \[, flags\]\) + +Draw an arc + +@status current Introduced in 2.4.0 + +## Parameters + +* `x,y` \(positive numbers\) coordinates of the center +* `r` \(positive number\) radius +* `start,end` \(positive numbers\) start and end of the arc +* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants + +## Return value + +none + diff --git a/lua_api_reference/lcd/drawcircle.md b/lua_api_reference/lcd/drawcircle.md new file mode 100644 index 000000000..ab24dc68e --- /dev/null +++ b/lua_api_reference/lcd/drawcircle.md @@ -0,0 +1,16 @@ +# lcd.drawCircle\(x, y, r \[, flags\]\) + +Draw a circle at \(x, y\) of specified radius + +@status current Introduced in 2.4.0 + +## Parameters + +* `x,y` \(positive numbers\) center position +* `r` \(number\) radius in pixels +* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants + +## Return value + +none + diff --git a/lua_api_reference/lcd/drawfilledcircle.md b/lua_api_reference/lcd/drawfilledcircle.md new file mode 100644 index 000000000..7eb094bab --- /dev/null +++ b/lua_api_reference/lcd/drawfilledcircle.md @@ -0,0 +1,16 @@ +# lcd.drawFilledCircle\(x, y, r \[, flags\]\) + +Draw a filled circle at \(x, y\) of specified radius + +@status current Introduced in 2.4.0 + +## Parameters + +* `x,y` \(positive numbers\) center position +* `r` \(number\) radius in pixels +* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants + +## Return value + +none + diff --git a/lua_api_reference/lcd/drawfilledtriangle.md b/lua_api_reference/lcd/drawfilledtriangle.md new file mode 100644 index 000000000..2fe02ed65 --- /dev/null +++ b/lua_api_reference/lcd/drawfilledtriangle.md @@ -0,0 +1,15 @@ +# lcd.drawFilledTriangle\(x1, y1, x2, y2, x3, y3 \[, flags\]\) + +Draw a filled triangle + +@status current Introduced in 2.4.0 + +## Parameters + +* `x1,y1,x2,y2,x3,y3` \(positive numbers\) coordinates of the three vertices +* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants + +## Return value + +none + diff --git a/lua_api_reference/lcd/drawhudrectangle.md b/lua_api_reference/lcd/drawhudrectangle.md new file mode 100644 index 000000000..6b70599fb --- /dev/null +++ b/lua_api_reference/lcd/drawhudrectangle.md @@ -0,0 +1,16 @@ +# lcd.drawHudRectangle\(pitch, roll, xmin, xmax, ymin, ymax \[, flags\]\) + +Draw a rectangle in perspective + +@status current Introduced in 2.4.0 + +## Parameters + +* `pitch,roll` \(positive numbers\) pitch and roll to define the orientation of the rectangle +* `xmin,xmax,ymin,ymax` \(positive numbers\) the limits of the rectangle +* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants + +## Return value + +none + diff --git a/lua_api_reference/lcd/drawlinewithclipping.md b/lua_api_reference/lcd/drawlinewithclipping.md new file mode 100644 index 000000000..daad8cf10 --- /dev/null +++ b/lua_api_reference/lcd/drawlinewithclipping.md @@ -0,0 +1,17 @@ +# lcd.drawLineWithClipping\(x1, y1, x2, y2, xmin, xmax, ymin, ymax, pattern \[, flags\]\) + +Draw a line only inside a rectangle + +@status current Introduced in 2.4.0 + +## Parameters + +* `x1,y1,x2,y1` \(positive numbers\) coordinates of the start and end of the unclipped line +* `xmin,xmax,ymin,ymax` \(positive numbers\) the limits of the rectangle inside which the line is drawn +* `pattern` \(FORCE, ERASE, DOTTED\) please see [Lcd functions overview](https://github.com/EdgeTX/lua-reference-guide/tree/2c4596e02006c8ac7d351fcd785fdfc7a93ce548/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd_functions-overview.html) +* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants + +## Return value + +none + diff --git a/lua_api_reference/lcd/drawpie.md b/lua_api_reference/lcd/drawpie.md new file mode 100644 index 000000000..2b29efb06 --- /dev/null +++ b/lua_api_reference/lcd/drawpie.md @@ -0,0 +1,17 @@ +# lcd.drawPie\(x, y, r, start, end \[, flags\]\) + +Draw a pie slice + +@status current Introduced in 2.4.0 + +## Parameters + +* `x,y` \(positive numbers\) coordinates of the center +* `r` \(positive number\) radius +* `start,end` \(positive numbers\) start and end of the pie slice +* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants + +## Return value + +none + diff --git a/lua_api_reference/lcd/drawtriangle.md b/lua_api_reference/lcd/drawtriangle.md new file mode 100644 index 000000000..5f4b6e6e4 --- /dev/null +++ b/lua_api_reference/lcd/drawtriangle.md @@ -0,0 +1,15 @@ +# lcd.drawTriangle\(x1, y1, x2, y2, x3, y3 \[, flags\]\) + +Draw a triangle + +@status current Introduced in 2.4.0 + +## Parameters + +* `x1,y1,x2,y2,x3,y3` \(positive numbers\) coordinates of the three vertices +* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants + +## Return value + +none + diff --git a/lua_api_reference/lcd/getColor.md b/lua_api_reference/lcd/getColor.md new file mode 100644 index 000000000..245dec4d6 --- /dev/null +++ b/lua_api_reference/lcd/getColor.md @@ -0,0 +1,23 @@ + + +## lcd.getColor(area) + + + +Get the color for specific area : see lcd.setColor for area list + +@status current Introduced in 2.3.11 + + +#### Parameters + +none + +#### Return value + +none + +##### Notice +Only available on Colorlcd radios + + diff --git a/lua_api_reference/lcd/getLastLeftPos.md b/lua_api_reference/lcd/getLastLeftPos.md new file mode 100644 index 000000000..ca0180784 --- /dev/null +++ b/lua_api_reference/lcd/getLastLeftPos.md @@ -0,0 +1,25 @@ + + +## lcd.getLastLeftPos() + + + +Returns the leftmost x position from previous drawtext or drawNumber output + +@status current Introduced in 2.2.0 + + +#### Parameters + +none + +#### Return value + +* `number` (integer) x position + + + +##### Notice +Only available on Taranis + + diff --git a/lua_api_reference/lcd/getLastPos.md b/lua_api_reference/lcd/getLastPos.md new file mode 100644 index 000000000..c816c8c08 --- /dev/null +++ b/lua_api_reference/lcd/getLastPos.md @@ -0,0 +1,28 @@ + + +## lcd.getLastPos() + + + +Returns the rightmost x position from previous output + +@status current Introduced in 2.0.0 + + +#### Parameters + +none + +#### Return value + +* `number` (integer) x position + + + +##### Notice +Only available on Taranis + + +For added clarity, it is recommended to use lcd.getLastRightPos() + + diff --git a/lua_api_reference/lcd/getLastRightPos.md b/lua_api_reference/lcd/getLastRightPos.md new file mode 100644 index 000000000..8394eddbb --- /dev/null +++ b/lua_api_reference/lcd/getLastRightPos.md @@ -0,0 +1,28 @@ + + +## lcd.getLastRightPos() + + + +Returns the rightest x position from previous drawtext or drawNumber output + +@status current Introduced in 2.2.0 + + +#### Parameters + +none + +#### Return value + +* `number` (integer) x position + + + +##### Notice +Only available on Taranis + + +This is strictly equivalent to former lcd.getLastPos() + + diff --git a/lua_api_reference/lcd/lcd.drawbitmappattern-bitmap-x-y-flags.md b/lua_api_reference/lcd/lcd.drawbitmappattern-bitmap-x-y-flags.md new file mode 100644 index 000000000..4521c37ce --- /dev/null +++ b/lua_api_reference/lcd/lcd.drawbitmappattern-bitmap-x-y-flags.md @@ -0,0 +1,19 @@ +# lcd.drawBitmapPattern(bitmap, x, y \[, flags]) + +Displays a bitmap pattern at (x,y) + +@status current Introduced in 2.8.0 + +**Parameters** + +* `bitmap` (pointer) point to a bitmap previously opened with Bitmap.open() +* `x,y` (positive numbers) starting coordinates +* `flags` (optional) please see Lcd functions overview + +**Return value** + +none + +**Notice** + +Only available on Horus diff --git a/lua_api_reference/lcd/lcd.drawbitmappatternpie-bitmap-x-y-startangle-endangle-flags.md b/lua_api_reference/lcd/lcd.drawbitmappatternpie-bitmap-x-y-startangle-endangle-flags.md new file mode 100644 index 000000000..ef9fcc396 --- /dev/null +++ b/lua_api_reference/lcd/lcd.drawbitmappatternpie-bitmap-x-y-startangle-endangle-flags.md @@ -0,0 +1,21 @@ +# lcd.drawBitmapPatternPie(bitmap, x, y, startAngle, endAngle \[, flags]) + +Displays a bitmap pattern pie at (x,y) + +@status current Introduced in 2.8.0 + +**Parameters** + +* `bitmap` (pointer) point to a bitmap previously opened with Bitmap.open() +* `x,y` (positive numbers) starting coordinates +* `startAngle` Start angle +* `endAngle` End angle +* `flags` (optional) please see Lcd functions overview + +**Return value** + +none + +**Notice** + +Only available on Horus diff --git a/lua_api_reference/lcd/lcd.drawtextlines-x-y-w-h-text-flags.md b/lua_api_reference/lcd/lcd.drawtextlines-x-y-w-h-text-flags.md new file mode 100644 index 000000000..90598b8a3 --- /dev/null +++ b/lua_api_reference/lcd/lcd.drawtextlines-x-y-w-h-text-flags.md @@ -0,0 +1,20 @@ +# lcd.drawTextLines(x, y, w, h, text \[, flags]) + +Draw text inside rectangle (x,y,w,h) with line breaks + +@status current Introduced in 2.5.0 + +## Parameters + +* `x,y` (positive numbers) starting coordinate +* `w,h` (positive numbers) width and height of bounding rectangle +* `text` (string) text to display +* `flags` (optional) please see [Lcd functions overview](lcd\_functions-overview.html) for drawing flags and colors, and [Appendix](../../appendix/fonts.md) for available characters in each font set. RIGHT, CENTER and VCENTER are not implemented. + +## Return value + +none + +## Notes + +* Color radios only. diff --git a/lua_api_reference/lcd/lcd.exitfullscreen.md b/lua_api_reference/lcd/lcd.exitfullscreen.md new file mode 100644 index 000000000..0b4343f2d --- /dev/null +++ b/lua_api_reference/lcd/lcd.exitfullscreen.md @@ -0,0 +1,10 @@ +# lcd.exitFullScreen\(\) + +Exit full screen widget mode. + +@status current Introduced in 2.5.0 + +### Notice + +Only available on radios with color display + diff --git a/lua_api_reference/lcd/lcd.invertrect-x-y-w-h-flags.md b/lua_api_reference/lcd/lcd.invertrect-x-y-w-h-flags.md new file mode 100644 index 000000000..3b0ee5ef5 --- /dev/null +++ b/lua_api_reference/lcd/lcd.invertrect-x-y-w-h-flags.md @@ -0,0 +1,16 @@ +# lcd.invertRect(x, y, w, h \[, flags]) + +Invert a rectangle zone from top left corner (x,y) of specified width and height + +@status current Introduced in 2.8.0 + +**Parameters** + +* `x,y` (positive numbers) top left corner position +* `w` (number) width in pixels +* `h` (number) height in pixels +* `flags` (optional) please see Lcd functions overview + +**Return value** + +none diff --git a/lua_api_reference/lcd/lcd_functions-overview.md b/lua_api_reference/lcd/lcd_functions-overview.md new file mode 100644 index 000000000..b8e329d39 --- /dev/null +++ b/lua_api_reference/lcd/lcd_functions-overview.md @@ -0,0 +1,57 @@ +# Lcd Functions Overview + +##### Description + +Lcd functions allow scripts to interact with the transmitter display. This access is limited to the 'run' functions of One-Time and Telemetry scripts. Widget scripts on the Horus (X10 and X12S) can make use of the lcd functions as well. + +##### 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.** + +Many of the lcd functions accept parameters named *flags* and *patterns*. The names and their meanings are described below. + +#### Flags Constants + +|Name|Description|Version|Notes| +|---|---|---|---| +|0|normal font, default precision for numeric||| +|DBLSIZE|double size font||| +|MIDSIZE|mid sized font||| +|SMLSIZE|small font||| +|INVERS|inverted display||| +|BLINK|blinking text||| +|XXLSIZE|jumbo font|2.0.6|| +|LEFT|left justify|2.0.6| Default for most functions not related to bitmaps| +|RIGHT|right justify||| +|PREC1|single decimal place||| +|PREC2|two decimal places||| +|GREY_DEFAULT|grey fill||| +|TIMEHOUR|dislay hours||Only for drawTimer| + +#### Patterns Constants + +|Name|Description| +|---|---| +|FORCE|pixels will be black| +|ERASE|pixels will be white| +|DOTTED|lines will appear dotted| + +#### Screen Constants + +|Name|Description| +|---|---| +|LCD_W|width in pixels| +|LCD_H|height in pixels| + +#### Screen Information + +| Radio | LCD_W | LCD_H | Colours | +| --- | --- | --- | --- | +| X7 | 128 | 64 | 1 bit | +| X9D | 212 | 64 | 4 bit | +| X9D+ | 212 | 64 | 4 bit | +| X9E | 212 | 64 | 4 bit | +| X10 | 480 | 272 | RGB565 | +| X12S | 480 | 272 | RGB565 | + + diff --git a/lua_api_reference/lcd/refresh.md b/lua_api_reference/lcd/refresh.md new file mode 100644 index 000000000..11364125d --- /dev/null +++ b/lua_api_reference/lcd/refresh.md @@ -0,0 +1,23 @@ + + +## lcd.refresh() + + + +Refresh the LCD screen + +@status current Introduced in 2.2.0 + + +#### Parameters + +none + +#### Return value + +none + +##### Notice +This function only works in stand-alone and telemetry scripts. + + diff --git a/lua_api_reference/lcd/resetBacklightTimeout.md b/lua_api_reference/lcd/resetBacklightTimeout.md new file mode 100644 index 000000000..391393c79 --- /dev/null +++ b/lua_api_reference/lcd/resetBacklightTimeout.md @@ -0,0 +1,19 @@ + + +## lcd.resetBacklightTimeout() + + + +Reset the backlight timeout + +@status current Introduced in 2.3.6 + + +#### Parameters + +none + +#### Return value + +none + diff --git a/lua_api_reference/lcd/setColor.md b/lua_api_reference/lcd/setColor.md new file mode 100644 index 000000000..4359303f6 --- /dev/null +++ b/lua_api_reference/lcd/setColor.md @@ -0,0 +1,68 @@ + + +## lcd.setColor(area, color) + + + +Set a color for specific area + +@status current Introduced in 2.2.0 + + +#### Parameters + +* `area` (unsigned number) specific screen area in the list bellow + * `CUSTOM_COLOR` + * `DEFAULT_COLOR` + * `DEFAULT_BGCOLOR` + * `FOCUS_COLOR` + * `FOCUS_BGCOLOR` + * `LINE_COLOR` + * `CHECKBOX_COLOR` + * `MENU_BGCOLOR` + * `MENU_COLOR` + * `MENU_TITLE_DISABLE_COLOR` + * `HEADER_COLOR` + * `ALARM_COLOR` + * `HIGHLIGHT_COLOR` + * `TEXT_DISABLE_COLOR` + * `HEADER_COLOR` + * `DISABLE_COLOR` + * `CURVE_CURSOR_COLOR` + * `TITLE_BGCOLOR` + * `TRIM_BGCOLOR` + * `TRIM_SHADOW_COLOR` + * `MAINVIEW_PANES_COLOR` + * `MAINVIEW_GRAPHICS_COLOR` + * `MENU_BGCOLOR` + * `HEADER_ICON_BGCOLOR` + * `HEADER_CURRENT_BGCOLOR` + * `MAINVIEW_PANES_COLOR` + * `MAINVIEW_GRAPHICS_COLOR` + * `OVERLAY_COLOR` + * `BARGRAPH1_COLOR` + * `BARGRAPH2_COLOR` + * `BARGRAPH_BGCOLOR` + * `CUSTOM_COLOR` + +* `color` (number) color in 5/6/5 rgb format. The following prefined colors are available + * `WHITE` + * `GREY` + * `LIGHTGREY` + * `DARKGREY` + * `BLACK` + * `YELLOW` + * `BLUE` + * `RED` + * `DARKRED` + + + +#### Return value + +none + +##### Notice +Only available on Colorlcd radios + + diff --git a/lua_api_reference/lcd/sizetext.md b/lua_api_reference/lcd/sizetext.md new file mode 100644 index 000000000..35937fc85 --- /dev/null +++ b/lua_api_reference/lcd/sizetext.md @@ -0,0 +1,15 @@ +# lcd.sizeText\(text \[, flags\]\) + +Get the width and height of a text string drawn with flags + +@status current Introduced in 2.5.0 + +## Parameters + +* `text` \(string\) +* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants + +## Return value + +* `w,h` \(integers\) width and height of the text + diff --git a/lua_api_reference/model/README.md b/lua_api_reference/model/README.md new file mode 100644 index 000000000..d92fe826b --- /dev/null +++ b/lua_api_reference/model/README.md @@ -0,0 +1,2 @@ +# Model Functions + diff --git a/lua_api_reference/model/defaultinputs.md b/lua_api_reference/model/defaultinputs.md new file mode 100644 index 000000000..6664a1e7e --- /dev/null +++ b/lua_api_reference/model/defaultinputs.md @@ -0,0 +1,14 @@ +# model.defaultInputs\(\) + +Set all inputs to defaults + +@status current Introduced in 2.0.0 + +## Parameters + +none + +## Return value + +none + diff --git a/lua_api_reference/model/deleteflightmodes.md b/lua_api_reference/model/deleteflightmodes.md new file mode 100644 index 000000000..d5fa704cb --- /dev/null +++ b/lua_api_reference/model/deleteflightmodes.md @@ -0,0 +1,14 @@ +# model.deleteFlightModes\(\) + +Clear all flightModes + +@status current Introduced in 2.3.10 + +## Parameters + +none + +## Return value + +none + diff --git a/lua_api_reference/model/deleteinput.md b/lua_api_reference/model/deleteinput.md new file mode 100644 index 000000000..9a0465148 --- /dev/null +++ b/lua_api_reference/model/deleteinput.md @@ -0,0 +1,15 @@ +# model.deleteInput\(input, line\) + +Delete line from specified input + +@status current Introduced in 2.0.0 + +## Parameters + +* `input` \(unsigned number\) input number \(use 0 for Input1\) +* `line` \(unsigned number\) input line \(use 0 for first line\) + +## Return value + +none + diff --git a/lua_api_reference/model/deleteinputs.md b/lua_api_reference/model/deleteinputs.md new file mode 100644 index 000000000..4790e714c --- /dev/null +++ b/lua_api_reference/model/deleteinputs.md @@ -0,0 +1,14 @@ +# model.deleteInputs\(\) + +Delete all Inputs + +@status current Introduced in 2.0.0 + +## Parameters + +none + +## Return value + +none + diff --git a/lua_api_reference/model/deletemix.md b/lua_api_reference/model/deletemix.md new file mode 100644 index 000000000..8e5225ae6 --- /dev/null +++ b/lua_api_reference/model/deletemix.md @@ -0,0 +1,15 @@ +# model.deleteMix\(channel, line\) + +Delete mixer line from specified Channel + +@status current Introduced in 2.0.0 + +## Parameters + +* `channel` \(unsigned number\) channel number \(use 0 for CH1\) +* `line` \(unsigned number\) mix number \(use 0 for first line\(mix\)\) + +## Return value + +none + diff --git a/lua_api_reference/model/deletemixes.md b/lua_api_reference/model/deletemixes.md new file mode 100644 index 000000000..bb854c832 --- /dev/null +++ b/lua_api_reference/model/deletemixes.md @@ -0,0 +1,14 @@ +# model.deleteMixes\(\) + +Remove all mixers + +@status current Introduced in 2.0.0 + +## Parameters + +none + +## Return value + +none + diff --git a/lua_api_reference/model/getcurve.md b/lua_api_reference/model/getcurve.md new file mode 100644 index 000000000..425bf5f9e --- /dev/null +++ b/lua_api_reference/model/getcurve.md @@ -0,0 +1,26 @@ +# model.getCurve(curve) + +Get Curve parameters + +Note this function uses Lua's usual index starting with 1 since version 2.9.0. + +@status current Introduced in 2.0.12, uses Lua's normal indexing as of 2.9.0 + +## Parameters + +* `curve` (unsigned number) curve number (use 0 for Curve1) + +## Return value + +* `nil` requested curve does not exist +* `table` curve data: + * `name` (string) name + * `type` (number) type + * `smooth` (boolean) smooth + * `points` (number) number of points + * `y` (table) table of Y values: + * `key` is point number (zero based) + * `value` is y value + * `x` (table) **only included for custom curve type**: + * `key` is point number (zero based) + * `value` is x value diff --git a/lua_api_reference/model/getcustomfunction.md b/lua_api_reference/model/getcustomfunction.md new file mode 100644 index 000000000..e6bda79b3 --- /dev/null +++ b/lua_api_reference/model/getcustomfunction.md @@ -0,0 +1,22 @@ +# model.getCustomFunction\(function\) + +Get Custom Function parameters + +@status current Introduced in 2.0.0, TODO rename function + +## Parameters + +* `function` \(unsigned number\) custom function number \(use 0 for CF1\) + +## Return value + +* `nil` requested custom function does not exist +* `table` custom function data: + * `switch` \(number\) switch index + * `func` \(number\) function index + * `name` \(string\) Name of track to play \(only returned only returned if action is play track, sound or script\) + * `value` \(number\) value \(only returned only returned if action is **not** play track, sound or script\) + * `mode` \(number\) mode \(only returned only returned if action is **not** play track, sound or script\) + * `param` \(number\) parameter \(only returned only returned if action is **not** play track, sound or script\) + * `active` \(number\) 0 = disabled, 1 = enabled + diff --git a/lua_api_reference/model/getflightmode.md b/lua_api_reference/model/getflightmode.md new file mode 100644 index 000000000..b8c77c014 --- /dev/null +++ b/lua_api_reference/model/getflightmode.md @@ -0,0 +1,25 @@ +# model.getFlightMode\(index\) + +Return input data for given input and line number + +@status current Introduced in 2.3.10 + +## Parameters + +* `index` \(unsigned number\) flight mode number \(use 0 for FM0\) + +## Return value + +* `nil` requested input or line does not exist +* `table` input data: + * `name` \(string\) input line name + * `switch` \(number\) input switch index + * `fadeIn` \(number\) fade in value \(in 0.1s\) + * `fadeOut` \(number\) fade out value \(in 0.1s\) + * `trimsValues` \(table\) table of trim values: + * `key` is trim number \(zero based\) + * `value` is trim value + * `trimsModes` \(table\) table of trim mode: + * `key` is trim number \(zero based\) + * `value` is trim mode + diff --git a/lua_api_reference/model/getglobalvariable.md b/lua_api_reference/model/getglobalvariable.md new file mode 100644 index 000000000..5f77a525c --- /dev/null +++ b/lua_api_reference/model/getglobalvariable.md @@ -0,0 +1,25 @@ +# model.getGlobalVariable\(index, flight\_mode\) + +Return current global variable value + +Example: + +```lua + -- get GV3 (index = 2) from Flight mode 0 (FM0) + val = model.getGlobalVariable(2, 0) +``` + +## Parameters + +* `index` zero based global variable index, use 0 for GV1, 8 for GV9 +* `flight_mode` Flight mode number \(0 = FM0, 8 = FM8\) + +## Return value + +* `nil` requested global variable does not exist +* `number` current value of global variable + +### Notice + +a simple warning or notice + diff --git a/lua_api_reference/model/getinfo.md b/lua_api_reference/model/getinfo.md new file mode 100644 index 000000000..c86f1de58 --- /dev/null +++ b/lua_api_reference/model/getinfo.md @@ -0,0 +1,18 @@ +# model.getInfo() + +Get current Model information + +@status current Introduced in 2.0.6, changed in 2.2.0, filename added in 2.6.0, extendedLimits, jitterFilter, and labels added in 2.8.0 + +## Parameters + +none + +## Return value + +* `table` model information: + * `name` (string) model name + * `extendedLimits` (boolean) extended limits enabled + * `jitterFilter` (number) model level ADC filter + * `bitmap` (string) bitmap name (not present on X7) + * `filename` (string) model filename diff --git a/lua_api_reference/model/getinput.md b/lua_api_reference/model/getinput.md new file mode 100644 index 000000000..48b6070fa --- /dev/null +++ b/lua_api_reference/model/getinput.md @@ -0,0 +1,26 @@ +# model.getInput\(input, line\) + +Return input data for given input and line number + +@status current Introduced in 2.0.0, curveType/curveValue/carryTrim added in 2.3, inputName added 2.3.10, flighmode reworked in 2.3.11 + +## Parameters + +* `input` \(unsigned number\) input number \(use 0 for Input1\) +* `line` \(unsigned number\) input line \(use 0 for first line\) + +## Return value + +* `nil` requested input or line does not exist +* `table` input data: + * `name` \(string\) input line name + * `inputName` \(string\) input input name + * `source` \(number\) input source index + * `weight` \(number\) input weight + * `offset` \(number\) input offset + * `switch` \(number\) input switch index + * `curveType` \(number\) curve type \(function, expo, custom curve\) + * `curveValue` \(number\) curve index + * `carryTrim` \(boolean\) input trims applied + * 'flightModes' \(number\) bit-mask of active flight modes + diff --git a/lua_api_reference/model/getinputscount.md b/lua_api_reference/model/getinputscount.md new file mode 100644 index 000000000..0b693e427 --- /dev/null +++ b/lua_api_reference/model/getinputscount.md @@ -0,0 +1,14 @@ +# model.getInputsCount\(input\) + +Return number of lines for given input + +@status current Introduced in 2.0.0 + +## Parameters + +* `input` \(unsigned number\) input number \(use 0 for Input1\) + +## Return value + +* `number` number of configured lines for given input + diff --git a/lua_api_reference/model/getlogicalswitch.md b/lua_api_reference/model/getlogicalswitch.md new file mode 100644 index 000000000..00f8928ce --- /dev/null +++ b/lua_api_reference/model/getlogicalswitch.md @@ -0,0 +1,21 @@ +# model.getLogicalSwitch(switch) + +Get Logical Switch parameters + +@status current Introduced in 2.0.0 + +## Parameters + +* `switch` (unsigned number) logical switch number (use 0 for LS1) + +## Return value + +* `nil` requested logical switch does not exist +* `table` logical switch data: + * `func` (number) function index, see [Logical Switch Function Constants](../constants/logical-switch-function-constants.md). + * `v1` (number) V1 value (index) + * `v2` (number) V2 value (index or value) + * `v3` (number) V3 value (index or value) + * `and` (number) AND switch index + * `delay` (number) delay (time in 1/10 s) + * `duration` (number) duration (time in 1/10 s) diff --git a/lua_api_reference/model/getmix.md b/lua_api_reference/model/getmix.md new file mode 100644 index 000000000..7a774e9cd --- /dev/null +++ b/lua_api_reference/model/getmix.md @@ -0,0 +1,31 @@ +# model.getMix\(channel, line\) + +Get configuration for specified Mix + +@status current Introduced in 2.0.0, parameters below `multiplex` added in 2.0.13 + +## Parameters + +* `channel` \(unsigned number\) channel number \(use 0 for CH1\) +* `line` \(unsigned number\) mix number \(use 0 for first line\(mix\)\) + +## Return value + +* `nil` requested channel or line does not exist +* `table` mix data: + * `name` \(string\) mix line name + * `source` \(number\) source index + * `weight` \(number\) weight \(1024 == 100%\) value or GVAR1..9 = 4096..4011, -GVAR1..9 = 4095..4087 + * `offset` \(number\) offset value or GVAR1..9 = 4096..4011, -GVAR1..9 = 4095..4087 + * `switch` \(number\) switch index + * `multiplex` \(number\) multiplex \(0 = ADD, 1 = MULTIPLY, 2 = REPLACE\) + * `curveType` \(number\) curve type \(function, expo, custom curve\) + * `curveValue` \(number\) curve index + * `flightModes` \(number\) bit-mask of active flight modes + * `carryTrim` \(boolean\) carry trim + * `mixWarn` \(number\) warning \(0 = off, 1 = 1 beep, .. 3 = 3 beeps\) + * `delayUp` \(number\) delay up \(time in 1/10 s\) + * `delayDown` \(number\) delay down + * `speedUp` \(number\) speed up + * `speedDown` \(number\) speed down + diff --git a/lua_api_reference/model/getmixescount.md b/lua_api_reference/model/getmixescount.md new file mode 100644 index 000000000..9a894652f --- /dev/null +++ b/lua_api_reference/model/getmixescount.md @@ -0,0 +1,14 @@ +# model.getMixesCount\(channel\) + +Get the number of Mixer lines that the specified Channel has + +@status current Introduced in 2.0.0 + +## Parameters + +* `channel` \(unsigned number\) channel number \(use 0 for CH1\) + +## Return value + +* `number` number of mixes for requested channel + diff --git a/lua_api_reference/model/getmodule.md b/lua_api_reference/model/getmodule.md new file mode 100644 index 000000000..df8290060 --- /dev/null +++ b/lua_api_reference/model/getmodule.md @@ -0,0 +1,49 @@ +# model.getModule\(index\) + +Get RF module parameters + +`Type` values: + +* 0 NONE +* 1 PPM +* 2 XJT\_PXX1 +* 3 ISRM\_PXX2 +* 4 DSM2 +* 5 CROSSFIRE +* 6 MULTIMODULE +* 7 R9M\_PXX1 +* 8 R9M\_PXX2 +* 9 R9M\_LITE\_PXX1 +* 10 R9M\_LITE\_PXX2 +* 11 R9M\_LITE\_PRO\_PXX1 +* 12 R9M\_LITE\_PRO\_PXX2 +* 13 SBUS +* 14 XJT\_LITE\_PXX2 + +`subType` values for XJT\_PXX1: + +* -1 OFF +* 0 D16 +* 1 D8 +* 2 LR12 + +@status current Introduced in 2.2.0 + +## Parameters + +* `index` \(number\) module index \(0 for internal, 1 for external\) + +## Return value + +* `nil` requested module does not exist +* `table` module parameters: + * `subType` \(number\) protocol index + * `modelId` \(number\) receiver number + * `firstChannel` \(number\) start channel \(0 is CH1\) + * `channelsCount` \(number\) number of channels sent to module + * `Type` \(number\) module type + * if the module type is Multi additional information are available + * `protocol` \(number\) protocol number \(Multi only\) + * `subProtocol` \(number\) sub-protocol number \(Multi only\) + * `channelsOrder` \(number\) first 4 channels expected order \(Multi only\) + diff --git a/lua_api_reference/model/getoutput.md b/lua_api_reference/model/getoutput.md new file mode 100644 index 000000000..72a4c9a8b --- /dev/null +++ b/lua_api_reference/model/getoutput.md @@ -0,0 +1,25 @@ +# model.getOutput\(index\) + +Get servo parameters + +@status current Introduced in 2.0.0 + +## Parameters + +* `index` \(unsigned number\) output number \(use 0 for CH1\) + +## Return value + +* `nil` requested output does not exist +* `table` output parameters: + * `name` \(string\) name + * `min` \(number\) Minimum % \* 10 + * `max` \(number\) Maximum % \* 10 + * `offset` \(number\) Subtrim \* 10 + * `ppmCenter` \(number\) offset from PPM Center. 0 = 1500 + * `symetrical` \(number\) linear Subtrim 0 = Off, 1 = On + * `revert` \(number\) irection 0 = ­­­---, 1 = INV + * `curve` + * \(number\) Curve number \(0 for Curve1\) + * or `nil` if no curve set + diff --git a/lua_api_reference/model/getsensor.md b/lua_api_reference/model/getsensor.md new file mode 100644 index 000000000..fd883b21e --- /dev/null +++ b/lua_api_reference/model/getsensor.md @@ -0,0 +1,22 @@ +# model.getSensor\(sensor\) + +Get Telemetry Sensor parameters + +@status current Introduced in 2.3.0 + +## Parameters + +* `sensor` \(unsigned number\) sensor number \(use 0 for sensor 1\) + +## Return value + +* `nil` requested sensor does not exist +* `table` with sensor data: + * `type` \(number\) 0 = custom, 1 = calculated + * `name` \(string\) Name + * `unit` \(number\) See list of units in the appendix of the OpenTX Lua Reference Guide + * `prec` \(number\) Number of decimals + * `id` \(number\) Only custom sensors + * `instance` \(number\) Only custom sensors + * `formula` \(number\) Only calculated sensors. 0 = Add etc. see list of formula choices in Companion popup + diff --git a/lua_api_reference/model/gettimer.md b/lua_api_reference/model/gettimer.md new file mode 100644 index 000000000..58cf40299 --- /dev/null +++ b/lua_api_reference/model/gettimer.md @@ -0,0 +1,22 @@ +# model.getTimer\(timer\) + +Get model timer parameters + +@status current Introduced in 2.0.0, name added in 2.3.6 + +## Parameters + +* `timer` \(number\) timer index \(0 for Timer 1\) + +## Return value + +* `nil` requested timer does not exist +* `table` timer parameters: + * `mode` \(number\) timer trigger source: off, abs, stk, stk%, sw/!sw, !m\_sw/!m\_sw + * `start` \(number\) start value \[seconds\], 0 for up timer, 0> down timer + * `value` \(number\) current value \[seconds\] + * `countdownBeep` \(number\) countdown beep \(0­ = silent, 1 =­ beeps, 2­ = voice\) + * `minuteBeep` \(boolean\) minute beep + * `persistent` \(number\) persistent timer + * `name` \(string\) timer name + diff --git a/lua_api_reference/model/insertinput.md b/lua_api_reference/model/insertinput.md new file mode 100644 index 000000000..0f39d66ea --- /dev/null +++ b/lua_api_reference/model/insertinput.md @@ -0,0 +1,16 @@ +# model.insertInput\(input, line, value\) + +Insert an Input at specified line + +@status current Introduced in 2.0.0, curveType/curveValue/carryTrim added in 2.3, inputName added 2.3.10 + +## Parameters + +* `input` \(unsigned number\) input number \(use 0 for Input1\) +* `line` \(unsigned number\) input line \(use 0 for first line\) +* `value` \(table\) input data, see model.getInput\(\) + +## Return value + +none + diff --git a/lua_api_reference/model/insertmix.md b/lua_api_reference/model/insertmix.md new file mode 100644 index 000000000..c9871f641 --- /dev/null +++ b/lua_api_reference/model/insertmix.md @@ -0,0 +1,16 @@ +# model.insertMix\(channel, line, value\) + +Insert a mixer line into Channel + +@status current Introduced in 2.0.0, parameters below `multiplex` added in 2.0.13 + +## Parameters + +* `channel` \(unsigned number\) channel number \(use 0 for CH1\) +* `line` \(unsigned number\) mix number \(use 0 for first line\(mix\)\) +* `value` \(table\) see model.getMix\(\) for table format + +## Return value + +none + diff --git a/lua_api_reference/model/model.getswashring.md b/lua_api_reference/model/model.getswashring.md new file mode 100644 index 000000000..ecaeed4cb --- /dev/null +++ b/lua_api_reference/model/model.getswashring.md @@ -0,0 +1,21 @@ +# model.getSwashRing() + +Get heli swash parameters + +@status current Introduced in 2.8.0 + +**Parameters** + +none + +**Return value** + +* `table` with heli swash parameters: +* `type` (number) 0=---, 1=120, 2=120X, 3=140, 4=90 +* `value` (number) swash ring value (normally 0) +* 'collectiveSource' (number) source index +* 'aileronSource' (number) source index +* 'elevatorSource' (number) source index +* 'collectiveWeight'(value) -100 to 100 +* 'aileronWeight' (value) -100 to 100 +* 'elevatorWeight' (value) -100 to 100 diff --git a/lua_api_reference/model/model.setswashring-params.md b/lua_api_reference/model/model.setswashring-params.md new file mode 100644 index 000000000..15bf63d3a --- /dev/null +++ b/lua_api_reference/model/model.setswashring-params.md @@ -0,0 +1,17 @@ +# model.setSwashRing(params) + +Set heli swash parameters + +@status current Introduced in 2.8.0 + +**Parameters** + +* `value` (table) swash ring parameters, see model.getSwashRing() for table format + +**Return value** + +none + +**Notice** + +If a parameter is missing, then that parameter remains unchanged. diff --git a/lua_api_reference/model/resetsensor.md b/lua_api_reference/model/resetsensor.md new file mode 100644 index 000000000..599d033ea --- /dev/null +++ b/lua_api_reference/model/resetsensor.md @@ -0,0 +1,14 @@ +# model.resetSensor\(sensor\) + +Reset Telemetry Sensor parameters + +@status current Introduced in 2.3.11 + +## Parameters + +* `sensor` \(unsigned number\) sensor number \(use 0 for sensor 1\) + +## Return value + +* `nil` + diff --git a/lua_api_reference/model/resettimer.md b/lua_api_reference/model/resettimer.md new file mode 100644 index 000000000..c2d7c30b9 --- /dev/null +++ b/lua_api_reference/model/resettimer.md @@ -0,0 +1,14 @@ +# model.resetTimer\(timer\) + +Reset model timer to a startup value + +@status current Introduced in TODO + +## Parameters + +* `timer` \(number\) timer index \(0 for Timer 1\) + +## Return value + +none + diff --git a/lua_api_reference/model/setcurve.md b/lua_api_reference/model/setcurve.md new file mode 100644 index 000000000..8fe36de64 --- /dev/null +++ b/lua_api_reference/model/setcurve.md @@ -0,0 +1,45 @@ +# model.setCurve\(curve, params\) + +Set Curve parameters + +The first and last x value must -100 and 100 and x values must be monotonically increasing + +@status current Introduced in 2.2.0 + +Example setting a 4-point custom curve: + +```lua + params = {} + params["x"] = {-100, -34, 77, 100} + params["y"] = {-70, 20, -89, -100} + params["smooth"] = true + params["type"] = 1 + val = model.setCurve(2, params) +``` + +setting a 6-point standard smoothed curve + +```lua + val = model.setCurve(3, {smooth=true, y={-100, -50, 0, 50, 100, 80}}) +``` + +## Parameters + +* `curve` \(unsigned number\) curve number \(use 0 for Curve1\) +* `params` see model.getCurve return format for table format. setCurve uses standard lua array indexing and arrays start at index 1 + +## Return value + +* \`\` 0 - Everything okay + + ```text + 1 - Wrong number of points + 2 - Invalid Curve number + 3 - Cuve does not fit anymore + 4 - point of out of index + 5 - x value not monotonically increasing + 6 - y value not in range [-100;100] + 7 - extra values for y are set + 8 - extra values for x are set + ``` + diff --git a/lua_api_reference/model/setcustomfunction.md b/lua_api_reference/model/setcustomfunction.md new file mode 100644 index 000000000..edabc9d7e --- /dev/null +++ b/lua_api_reference/model/setcustomfunction.md @@ -0,0 +1,18 @@ +# model.setCustomFunction(function, value) + +Set Custom Function parameters + +@status current Introduced in 2.0.0, TODO rename function + +## Parameters + +* `function` (unsigned number) custom function number, see [Special Function Constants](../constants/special-function-constants.md). +* `value` (table) custom function parameters, see model.getCustomFunction() for table format + +## Return value + +none + +### Notice + +If a parameter is missing from the value, then that parameter remains unchanged. diff --git a/lua_api_reference/model/setflightmode.md b/lua_api_reference/model/setflightmode.md new file mode 100644 index 000000000..89ee23596 --- /dev/null +++ b/lua_api_reference/model/setflightmode.md @@ -0,0 +1,15 @@ +# model.setFlightMode\(index, params\) + +Set Flight mode parameters + +@status current Introduced in 2.3.10 + +## Parameters + +* `index` \(unsigned number\) flight mode number \(use 0 for FM0\) +* `params` see model.getFlightMode return format for table format. + +## Return value + +none + diff --git a/lua_api_reference/model/setglobalvariable.md b/lua_api_reference/model/setglobalvariable.md new file mode 100644 index 000000000..faabd4c62 --- /dev/null +++ b/lua_api_reference/model/setglobalvariable.md @@ -0,0 +1,18 @@ +# model.setGlobalVariable\(index, flight\_mode, value\) + +Sets current global variable value. See also model.getGlobalVariable\(\) + +## Parameters + +* `index` zero based global variable index, use 0 for GV1, 8 for GV9 +* `flight_mode` Flight mode number \(0 = FM0, 8 = FM8\) +* `value` new value for global variable. Permitted range is from -1024 to 1024. + +## Return value + +none + +### Notice + +Global variable can only store integer values, any floating point value is converted into integer value by truncating everything behind a floating point. + diff --git a/lua_api_reference/model/setinfo.md b/lua_api_reference/model/setinfo.md new file mode 100644 index 000000000..8f8440be7 --- /dev/null +++ b/lua_api_reference/model/setinfo.md @@ -0,0 +1,18 @@ +# model.setInfo\(value\) + +Set the current Model information + +@status current Introduced in 2.0.6, changed in TODO + +## Parameters + +* `value` model information data, see model.getInfo\(\) + +## Return value + +none + +### Notice + +If a parameter is missing from the value, then that parameter remains unchanged. + diff --git a/lua_api_reference/model/setlogicalswitch.md b/lua_api_reference/model/setlogicalswitch.md new file mode 100644 index 000000000..edbf48dfa --- /dev/null +++ b/lua_api_reference/model/setlogicalswitch.md @@ -0,0 +1,21 @@ +# model.setLogicalSwitch\(switch, value\) + +Set Logical Switch parameters + +@status current Introduced in 2.0.0 + +## Parameters + +* `switch` \(unsigned number\) logical switch number \(use 0 for LS1\) +* `value` \(table\) see model.getLogicalSwitch\(\) for table format + +## Return value + +none + +### Notice + +If a parameter is missing from the value, then that parameter remains unchanged. + +To set the `and` member \(which is Lua keyword\) use the following syntax: `model.setLogicalSwitch(30, {func=4,v1=1,v2=-99, ["and"]=24})` + diff --git a/lua_api_reference/model/setmodule.md b/lua_api_reference/model/setmodule.md new file mode 100644 index 000000000..ba2c81eb5 --- /dev/null +++ b/lua_api_reference/model/setmodule.md @@ -0,0 +1,19 @@ +# model.setModule\(index, value\) + +Set RF module parameters + +@status current Introduced in 2.2.0, modified in 2.3.12 \(proto/subproto\) + +## Parameters + +* `index` \(number\) module index \(0 for internal, 1 for external\) +* `value` module parameters, see model.getModule\(\) + +## Return value + +none + +### Notice + +If a parameter is missing from the value, then that parameter remains unchanged. + diff --git a/lua_api_reference/model/setoutput.md b/lua_api_reference/model/setoutput.md new file mode 100644 index 000000000..5fb0fc60c --- /dev/null +++ b/lua_api_reference/model/setoutput.md @@ -0,0 +1,19 @@ +# model.setOutput\(index, value\) + +Set servo parameters + +@status current Introduced in 2.0.0 + +## Parameters + +* `index` \(unsigned number\) channel number \(use 0 for CH1\) +* `value` \(table\) servo parameters, see model.getOutput\(\) for table format + +## Return value + +none + +### Notice + +If a parameter is missing from the value, then that parameter remains unchanged. + diff --git a/lua_api_reference/model/settimer.md b/lua_api_reference/model/settimer.md new file mode 100644 index 000000000..2bf783203 --- /dev/null +++ b/lua_api_reference/model/settimer.md @@ -0,0 +1,19 @@ +# model.setTimer\(timer, value\) + +Set model timer parameters + +@status current Introduced in 2.0.0, name added in 2.3.6 + +## Parameters + +* `timer` \(number\) timer index \(0 for Timer 1\) +* `value` timer parameters, see model.getTimer\(\) + +## Return value + +none + +### Notice + +If a parameter is missing from the value, then that parameter remains unchanged. + diff --git a/script_type_overview/README.md b/script_type_overview/README.md new file mode 100644 index 000000000..a3a6290d6 --- /dev/null +++ b/script_type_overview/README.md @@ -0,0 +1,8 @@ +--- +description: >- + This section introduces the types of Lua scripts supported by EdgeTX and how + they may be used. +--- + +# Part I - Script Type Overview + diff --git a/script_type_overview/function_scripts.md b/script_type_overview/function_scripts.md new file mode 100644 index 000000000..1882efa77 --- /dev/null +++ b/script_type_overview/function_scripts.md @@ -0,0 +1,52 @@ +# Function Scripts + +## Overview + +Function scripts are invoked via the **'Lua Script'** option of Special Functions configuration page. + +Typical uses of Function scripts are: + +* specialized handling in response to switch position changes +* customized announcements + +Please be aware that: + +* all function scripts are stopped if a One-Time Lua script is running +* Function scripts **DO NOT HAVE ACCESS TO LCD DISPLAY** + +## Lifetime + +* `init` function is called once when the model is selected +* depending on the switch associated with the Special Function, either the `run` function \(switch = on\) or the `background` function \(switch = off\) is called periodically +* the script is stopped and disabled if it misbehaves \(e.g. run-time error or low memory\) + +## File Location + +Scripts are located on the SD card in the folder /SCRIPTS/FUNCTIONS/<_name_>.lua. File name length \(without extension\) **must be 6 characters or less** \(this limit was 8 characters in OpenTX 2.1\). + +## Interface + +Every script must include a `return` statement at the end, defining its interface to EdgeTX. This statement returns a table with the following fields: + +* `init` function \(optional\) +* `run` function +* `background` function \(optional\) + +### Example + +```lua +local function init() + -- Called once when the script is loaded +end + +local function run() + -- Called periodically while the Special Function switch is on +end + +local function background() + -- Called periodically while the Special Function switch is off +end + +return { run=run, background=background, init=init } +``` + diff --git a/script_type_overview/mix.md b/script_type_overview/mix.md new file mode 100644 index 000000000..0f51cdc72 --- /dev/null +++ b/script_type_overview/mix.md @@ -0,0 +1,113 @@ +# Custom (Mixer) Scripts + +_**WARNING -**_ **Do not use Lua Custom scripts for controlling any aspect of your model that could cause a crash if the script stops executing!** + +## Overview + +Each model can have several custom scripts associated with it, and these scripts are run periodically. They behave similarly to standard OpenTX mixers, but at the same time they provide a much more flexible and powerful tool. Custom scripts take one or more values as inputs, do some processing in Lua code, and output one or more values. + +**Please note:** the firmware must be compiled with the option `LUA_MIXER=Y` for Custom scripts to be available. + +**Please note:** the scripts should be as short as possible, to avoid delays. It is also important to keep in mind that other loaded Telemetry and Function scripts can add to the response time, or worse: hang the system! + +### Typical uses + +* replacement for complex mixes that are _not critical_ to model function +* complex processing of inputs and reaction to their current state and/or their history +* filtering of telemetry values + +### Limitations + +* cannot update LCD screen or perform user input. +* should not exceed allowed run-time/ number of instructions. +* custom scripts are run with less priority than built-in mixes. Their execution period is around 30ms and is not guaranteed! +* can be disabled/killed anytime due to logic errors in script, not enough free memory, etc...) + +## Lifetime + +* Custom scripts are loaded from SD card when model is selected +* `init` \_\_function is called first +* `run` function is called periodically (about 30 times per second) +* the script is killed (stopped and disabled) if it misbehaves (e.g. run-time error or low memory) +* all Custom scripts are stopped while a One-Time script is running (see Lua One-time scripts) + +### Disabled script + +If the script output is used as a `mixer source` , and the script is killed for whatever reason, then _the whole mixer line is disabled_ ! This can be used for example to provide a fallback in case Lua Custom script is killed. + +Example where Lua mix script is used to drive ailerons in some clever way, but control falls back to the standard aileron mix if script is killed. Second mixer line replaces the first one when the script is alive: + +``` +CH1 [I4]Ail Weight(+100%) + := LUA4b Weight(+100%) +``` + +## File Location + +Place them on SD card in folder /SCRIPTS/MIXES/. File name length (without extension) **must be 6 characters or less** (this limit was 8 characters in OpenTX 2.1). + +## Interface + +Every script must include a `return` statement at the end, defining its interface to EdgeTX. This statement returns a table with the following fields: + +* `input` table (optional) +* `output` table (optional) +* `init` function (optional) +* `run` function + +### Example + +```lua +local input = + { + { "Strength", SOURCE}, -- user selects source (typically slider or knob) + { "Interval", VALUE, 0, 100, 0 } -- interval value, default = 0. + } + +local output = { "Val1", "Val2" } + +local function init() + -- Called once when the script is loaded +end + +local function run(Strength, Interval) -- Must match input table + local v1, v2 + -- Called periodically + return v1, v2 -- Must match output table +end + +return { input=input, output=output, run=run, init=init } +``` + +#### Input table + +The input table defines what values are available as input(s) to custom scripts. There are two forms of input table entries. + +``` +{ "", SOURCE } +``` + +SOURCE inputs provide the current value of a selected OpenTX variable. The source must be selected by the user when the script is configured. Source can be any value that EdgeTX knows about (inputs, channels, telemetry values, switches, custom functions etc.).\ +**Note:** the typical input range is -1024 thru +1024. Simply divide the input value by 10.24 to convert to a percentage from -100% to +100%. + +``` +{ "", VALUE, , , } +``` + +VALUE inputs provide a constant value that is set by the user when the script is configured. + +* _name_ - maximum length of 8 characters +* _min_ - minimum value of -128 +* _max_ - maximum value of 127 +* _default_ - must be within the valid range specified +* **Maximum of 6 inputs per script** (was 8 in 2.1) + +#### Output table + +The output table defines only name(s), as the actual values are returned by the script's run function. + +```lua +{ "", "" } +``` + +**Note:** the above names are only visible as source values on the radio screen when the script is running. If the model is edited in Companion, then the values show as `LUA1a` and `LUA1b` etc. diff --git a/script_type_overview/one-time_scripts.md b/script_type_overview/one-time_scripts.md new file mode 100644 index 000000000..496df205b --- /dev/null +++ b/script_type_overview/one-time_scripts.md @@ -0,0 +1,56 @@ +# One-Time Scripts + +_**WARNING -**_ **Running a One-Time script will suspend execution of all other currently loaded Lua scripts (Custom, Telemetry, and Functions)** + +## Overview + +One-Time scripts start when called upon by a specific radio function or when the user selects them from a contextual menu. They do their task and are then terminated and unloaded. Please note that all persistent scripts are halted during the execution of One-Time scripts. They are automatically restarted once the One-Time script is finished. This is done to provide enough system resources to execute the One-Time script. + +## Lifetime + +Script is executed when user selects Execute on a script file from SD card browser screen, or opens a Lua Tool, or creates a new model with a Wizard script. + +The script executes until: + +* it returns value different from 0 +* is forcefully closed by user by long press of EXIT key +* is forcefully closed by system if it misbehaves (e.g. run-time error or low + + memory) + +## File Location + +General One-Time scripts can be placed anywhere on SD card, however, the folder /SCRIPTS/ is recommended. + +Tool scripts must be stored in /SCRIPTS/TOOLS. + +Wizard scripts must be stored in the same subfolder of /TEMPLATES/ with the same "first name" as the template file using it. Some Wizard scripts are just small scripts that load one of the common scripts located in /SCRIPTS/WIZARD/. + +## **Interface** + +Every script must include a `return` statement at the end, defining its interface to EdgeTX. This statement returns a table with the following fields: + +* `init` function (optional) +* `run` function + +### Example + +```lua +local function init() + -- init is called once when model is loaded +end + +local function run(event, touchState) + -- run is called periodically only when screen is visible + -- A non-zero return value will halt the script + return x +end + +return { run=run, init=init } +``` + +### Notes: + +* The `event` parameter indicates which transmitter key has been pressed (see [Key Events](../part\_iii\_-\_opentx\_lua\_api\_reference/constants/key\_events.md)). +* The `touchState` value is only present when `event` is a touch event (see [Touch State Events](../part\_iii\_-\_opentx\_lua\_api\_reference/constants/touch-event-constants.md)). +* A non-zero return value from `run` will halt the script. If the return value is a text string with the file path to a new Lua script, then the new script will be loaded and run. diff --git a/script_type_overview/telemetry.md b/script_type_overview/telemetry.md new file mode 100644 index 000000000..f4f88da4e --- /dev/null +++ b/script_type_overview/telemetry.md @@ -0,0 +1,51 @@ +# Telemetry Scripts + +## Overview + +Telemetry scripts are used for building customized screens. Each model can have up to three active scripts as configured on the model's telemetry configuration page. The same script can be assigned to multiple models. + +**Please note:** Telemetry scripts are only available on radios with telemetry screens, such as e.g. FrSky Taranis models \(including Xlite\), Radiomaster TX12 and and Jumper T12. + +## Lifetime + +* Telemetry scripts are loaded when the model is selected. +* `init` function is called one time when the script is loaded +* `background` function is periodically; both when the telemetry screen is visible and when it is not. +* `run` function is called periodically only when the telemetry screen is visible +* script is stopped and disabled if it misbehaves \(e.g. run-time error or low memory\) +* all telemetry scripts are stopped if a one-time script is running \(see One-time scripts\) + +## File Location + +Scripts are located on the SD card in the folder /SCRIPTS/TELEMETRY/<_name_>.lua. File name length \(without extension\) **must be 6 characters or less** \(this limit was 8 characters in OpenTX 2.1\). + +## Interface + +Every script must include a `return` statement at the end, defining its interface to EdgeTX. This statement returns a table with the following fields: + +* `init` function \(optional\) +* `background` function \(optional\) +* `run` function + +### Example + +```lua +local function init() + -- init is called once when model is loaded +end + +local function background() + -- background is called periodically +end + +local function run(event) + -- run is called periodically only when screen is visible +end + +return { run = run, background = background, init = init } +``` + +### Notes: + +* The `event` parameter indicates which transmitter key has been pressed \(see [Key Events](../part_iii_-_opentx_lua_api_reference/constants/key_events.md)\). + diff --git a/script_type_overview/widget_scripts.md b/script_type_overview/widget_scripts.md new file mode 100644 index 000000000..05e4c95bc --- /dev/null +++ b/script_type_overview/widget_scripts.md @@ -0,0 +1,109 @@ +# Widget Scripts + +## Overview + +Most of the time, widget scripts show some info in a _zone_ either in the _top bar_ or in one of the user defined _main views_, and they cannot receive direct input from the user via key events like e.g. Telemetry scripts. + +But widgets on the main views can also be shown in _full screen mode_, where they take over the entire screen area. And here they receive user input via key events, and for radios with touch screen, also touch events. Full screen mode can be entered by selecting the widget, pressing ENTER and selecting **Full screen** on the widget menu, or by double tapping the widget on radios with a touch screen. Full screen mode can be exited by long pressing the RETURN button, or by calling the Lua function `lcd.exitFullScreen()`. + +Each model can have up to five main views, with up to 8 widgets per screen, depending on their size and layout. Each instance of a widget has his own _options_ table. + +**Please note:** Widget scripts are only available on radios with color screens, e.g. FrSky Horus models, Radiomaster TX16 and Jumper T16. + +## Lifetime + +All widget scripts on the SD card are loaded into memory when the model is selected; even widgets that are not used. This has the side effect that any global functions defined in a widget script will always be available to other widget scripts. It also means that any script on the SD card will consume part of the radio's memory - even if it is not being used. Therefore, it is important to either keep widget scripts small, or to use Lua's loadScript() function to load code dynamically. + +They can be added to the top bar or a main view through the telemetry setup menu. When a widget has been added to a screen, then the widget functions are called as follows: + +* `create` is called once when the widget instance is registered (started). +* `update` is called when widget settings are changed by the user. +* `background` is called periodically when the widget instance _is_ _not_ visible. **Note:** this is different from the way that telemetry scripts are handled. +* `refresh` is called periodically when the widget instance _is_ visible. **Note:** if you want `background` to run when the widget is visible, then call it from `refresh`. +* A widget script is stopped and disabled if it misbehaves (e.g. too long runtime, run-time error, or low memory) +* All widgets are stopped while a One-Time script is running (see [One-Time scripts](one-time\_scripts.md)). + +## File Location + +Widgets are located on the SD card, each in their specific folder /WIDGETS/<_name_>/main.lua (<_name_> must be in 8 characters or less). + +## Interface + +Every script must include a `return` statement at the end, defining its interface to EdgeTX. This statement returns a table with the following fields: + +* `name` string +* `options` table +* `create` function +* `update` function +* `background` function (optional) +* `refresh` function + +### Example + +```lua +local name = "WidgetName" + +-- Create a table with default options +-- Options can be changed by the user from the Widget Settings menu +-- Notice that each line is a table inside { } +local options = { + { "Source", SOURCE, 1 }, + -- BOOL is actually not a boolean, but toggles between 0 and 1 + { "Boolean", BOOL, 1 }, + { "Value", VALUE, 1, 0, 10}, + { "Color", COLOR, ORANGE }, + { "Text", STRING, "Max8chrs" } +} + +local function create(zone, options) + -- Runs one time when the widget instance is registered + -- Store zone and options in the widget table for later use + local widget = { + zone = zone, + options = options + } + -- Add local variables to the widget table, + -- unless you want to share with other instances! + widget.someVariable = 3 + -- Return widget table to EdgeTX + return widget +end + +local function update(widget, options) + -- Runs if options are changed from the Widget Settings menu + widget.options = options +end + +local function background(widget) + -- Runs periodically only when widget instance is not visible +end + +local function refresh(widget, event, touchState) + -- Runs periodically only when widget instance is visible + -- If full screen, then event is 0 or event value, otherwise nil +end + +return { + name = name, + options = options, + create = create, + update = update, + refresh = refresh, + background = background +} +``` + +### Notes + +* The `name` must be max. 10 characters long. +* `options` is passed to `create` and then stored in Lua. Changing it has no effect on EdgeTX. +* If `options` is changed by the user in the Widget Settings menu, then `update` will be called with a new `options` table, unaffected by any changes made by Lua code to the old `options` table. +* Maximum five `options` are allowed, with names of max. 10 characters, and no spaces. cf. [widget options constants](../part\_iii\_-\_opentx\_lua\_api\_reference/constants/widget-options.md) for valid option types. +* If local variables are declared outside functions in the widget script, then they are shared between all instances of the widget. +* Therefore, local variables that are private for each instance should be added to the `widget` table in the `create` function before returning the `widget` table to EdgeTX. +* When the widget is in full screen mode, then `event` is either 0, a [key event value](../part\_iii\_-\_opentx\_lua\_api\_reference/constants/key\_events.md), or a [touch event value](../part\_iii\_-\_opentx\_lua\_api\_reference/constants/touch-event-constants.md). +* If `event` is a [touch event value](../part\_iii\_-\_opentx\_lua\_api\_reference/constants/touch-event-constants.md), then `touchState` is a table. Otherwise, it is `nil`. +* When the widget is not in full screen mode, then both `event` and `touchState` are `nil`. +* The size of the widget's screen area is as follows: + * Full screen mode: `LCD_W` by `LCD_H` + * Not full screen mode: `zone.w` by `zone.h` (updated if screen options are changed) From c0d03672cdf1d308ac7dad89ca5da26e27f9f1b3 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Mon, 2 Oct 2023 15:45:13 +1000 Subject: [PATCH 2/3] chore: cleanup delete old folders delete old folders chore: more cleanup --- .../getsize.md | 29 ---------------- .../open.md | 34 ------------------- .../getsize.md | 20 ----------- .../open.md | 24 ------------- 4 files changed, 107 deletions(-) delete mode 100644 part_iii_-_opentx_lua_api_reference/Bitmap-functions-less-than-greater-than-luadoc-begin-Bitmap/getsize.md delete mode 100644 part_iii_-_opentx_lua_api_reference/Bitmap-functions-less-than-greater-than-luadoc-begin-Bitmap/open.md delete mode 100644 part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/getsize.md delete mode 100644 part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/open.md diff --git a/part_iii_-_opentx_lua_api_reference/Bitmap-functions-less-than-greater-than-luadoc-begin-Bitmap/getsize.md b/part_iii_-_opentx_lua_api_reference/Bitmap-functions-less-than-greater-than-luadoc-begin-Bitmap/getsize.md deleted file mode 100644 index 347282bfa..000000000 --- a/part_iii_-_opentx_lua_api_reference/Bitmap-functions-less-than-greater-than-luadoc-begin-Bitmap/getsize.md +++ /dev/null @@ -1,29 +0,0 @@ - - -## Bitmap.getSize(name) - - - -Return width, height of a bitmap object - -@status current Introduced in 2.2.0 - - -#### Parameters - -* `bitmap` (pointer) point to a bitmap previously opened with Bitmap.open() - - - -#### Return value - -* `multiple` returns 2 values: - * (number) width in pixels - * (number) height in pixels - - - -##### Notice -Only available on Horus - - diff --git a/part_iii_-_opentx_lua_api_reference/Bitmap-functions-less-than-greater-than-luadoc-begin-Bitmap/open.md b/part_iii_-_opentx_lua_api_reference/Bitmap-functions-less-than-greater-than-luadoc-begin-Bitmap/open.md deleted file mode 100644 index 45a6c8c3a..000000000 --- a/part_iii_-_opentx_lua_api_reference/Bitmap-functions-less-than-greater-than-luadoc-begin-Bitmap/open.md +++ /dev/null @@ -1,34 +0,0 @@ - - -## Bitmap.open(name) - - - -Loads a bitmap in memory, for later use with lcd.drawBitmap(). Bitmaps should be loaded only -once, returned object should be stored and used for drawing. If loading fails for whatever -reason the resulting bitmap object will have width and height set to zero. - -Bitmap loading can fail if: - * File is not found or contains invalid image - * System is low on memory - * Combined memory usage of all Lua script bitmaps exceeds certain value - -@status current Introduced in 2.2.0 - - -#### Parameters - -* `name` (string) full path to the bitmap on SD card (i.e. “/IMAGES/test.bmp”) - - - -#### Return value - -* `bitmap` (object) a bitmap object that can be used with other bitmap functions - - - -##### Notice -Only available on Horus - - diff --git a/part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/getsize.md b/part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/getsize.md deleted file mode 100644 index d7e790d63..000000000 --- a/part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/getsize.md +++ /dev/null @@ -1,20 +0,0 @@ -# Bitmap.getSize\(name\) - -Return width, height of a bitmap object - -@status current Introduced in 2.2.0 - -## Parameters - -* `bitmap` \(pointer\) point to a bitmap previously opened with Bitmap.open\(\) - -## Return value - -* `multiple` returns 2 values: - * \(number\) width in pixels - * \(number\) height in pixels - -### Notice - -Only available on Horus - diff --git a/part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/open.md b/part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/open.md deleted file mode 100644 index a6ff06b97..000000000 --- a/part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/open.md +++ /dev/null @@ -1,24 +0,0 @@ -# Bitmap.open\(name\) - -Loads a bitmap in memory, for later use with lcd.drawBitmap\(\). Bitmaps should be loaded only once, returned object should be stored and used for drawing. If loading fails for whatever reason the resulting bitmap object will have width and height set to zero. - -Bitmap loading can fail if: - -* File is not found or contains invalid image -* System is low on memory -* Combined memory usage of all Lua script bitmaps exceeds certain value - -@status current Introduced in 2.2.0 - -## Parameters - -* `name` \(string\) full path to the bitmap on SD card \(i.e. “/IMAGES/test.bmp”\) - -## Return value - -* `bitmap` \(object\) a bitmap object that can be used with other bitmap functions - -### Notice - -Only available on Horus - From 72ef45897a351d9b62f78872948c6a2ea9c5151d Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Mon, 2 Oct 2023 15:45:13 +1000 Subject: [PATCH 3/3] chore: cleanup delete old folders delete old folders chore: more cleanup --- Bitmap/getSize.md | 29 --- Bitmap/open.md | 34 --- RadioSpecialFunctions.png | Bin 108528 -> 0 bytes SUMMARY.md | 190 --------------- acknowledgments.md | 13 - debugging_techniques.md | 95 -------- function_scripts.md | 129 ---------- getting_started.md | 16 -- handling_gps_sensor_data.md | 58 ----- handling_lipo_sensor_data.md | 47 ---- included_lua_libraries.md | 16 -- init_function_syntax.md | 17 -- input_table_syntax.md | 46 ---- introduction.md | 3 - key_events.md | 74 ------ known_issues.md | 21 -- lcd/RGB.md | 31 --- lcd/clear.md | 25 -- lcd/drawBitmap.md | 30 --- lcd/drawChannel.md | 26 -- lcd/drawCombobox.md | 36 --- lcd/drawFilledRectangle.md | 27 --- lcd/drawGauge.md | 31 --- lcd/drawLine.md | 32 --- lcd/drawNumber.md | 30 --- lcd/drawPixmap.md | 27 --- lcd/drawPoint.md | 31 --- lcd/drawRectangle.md | 29 --- lcd/drawScreenTitle.md | 30 --- lcd/drawSource.md | 25 -- lcd/drawSwitch.md | 26 -- lcd/drawText.md | 35 --- lcd/drawTimer.md | 29 --- lcd/getColor.md | 23 -- lcd/getLastLeftPos.md | 25 -- lcd/getLastPos.md | 28 --- lcd/getLastRightPos.md | 28 --- lcd/lcd_functions-overview.md | 57 ----- lcd/refresh.md | 23 -- lcd/resetBacklightTimeout.md | 19 -- lcd/setColor.md | 68 ------ lua_data_sharing_across_scripts.md | 178 -------------- mix.md | 86 ------- model/defaultInputs.md | 19 -- model/deleteFlightModes.md | 19 -- model/deleteInput.md | 23 -- model/deleteInputs.md | 19 -- model/deleteMix.md | 23 -- model/deleteMixes.md | 19 -- model/getCurve.md | 38 --- model/getCustomFunction.md | 32 --- model/getFlightMode.md | 35 --- model/getGlobalVariable.md | 36 --- model/getInfo.md | 23 -- model/getInput.md | 37 --- model/getInputsCount.md | 23 -- model/getLogicalSwitch.md | 32 --- model/getMix.md | 42 ---- model/getMixesCount.md | 23 -- model/getModule.md | 57 ----- model/getOutput.md | 35 --- model/getSensor.md | 32 --- model/getTimer.md | 32 --- model/insertInput.md | 25 -- model/insertMix.md | 25 -- model/resetSensor.md | 21 -- model/resetTimer.md | 21 -- model/setCurve.md | 51 ---- model/setCustomFunction.md | 28 --- model/setFlightMode.md | 23 -- model/setGlobalVariable.md | 30 --- model/setInfo.md | 26 -- model/setLogicalSwitch.md | 32 --- model/setModule.md | 28 --- model/setOutput.md | 28 --- model/setTimer.md | 28 --- one-time_scripts.md | 23 -- optimization_tricks.md | 31 --- output_table_syntax.md | 37 --- part_i_-_script_type_overview.md | 3 - part_i_-_script_type_overview/README.md | 8 - .../function_scripts.md | 52 ---- part_i_-_script_type_overview/telemetry.md | 51 ---- .../widget_scripts.md | 109 --------- part_ii_-_opentx_lua_api_programming_guide.md | 2 - .../README.md | 4 - ...ta-exchange-with-the-edgetx-model-setup.md | 103 -------- .../drawing-flags-and-colors.md | 53 ---- .../included_lua_libraries/README.md | 13 - .../included_lua_libraries/bit32.library.md | 4 - .../io-library/README.md | 52 ---- .../io-library/io.close.md | 11 - .../io-library/io.open.md | 16 -- .../io-library/io.read.md | 15 -- .../io-library/io.seek.md | 15 -- .../io-library/io.write.md | 13 - .../included_lua_libraries/math.library.md | 4 - .../included_lua_libraries/string.library.md | 4 - .../init_function_syntax.md | 18 -- .../input_table_syntax.md | 51 ---- .../loading-code-modules-dynamically.md | 37 --- .../lua-basics.md | 84 ------- .../output_table_syntax.md | 35 --- .../return_statement_syntax.md | 22 -- .../run_function_syntax.md | 47 ---- .../saving-memory.md | 174 -------------- .../using-key-and-touch-events.md | 226 ------------------ part_iii_-_opentx_lua_api_reference.md | 3 - part_iii_-_opentx_lua_api_reference/README.md | 4 - .../README.md | 2 - .../bitmap.resize-bitmap-width-height.md | 19 -- .../bitmap.tomask-bitmap.md | 17 -- .../constants/README.md | 12 - .../constants/color-constants.md | 82 ------- .../constants/flags-and-pattern-constants.md | 38 --- .../constants/key_events.md | 82 ------- .../logical-switch-function-constants.md | 25 -- .../constants/screen-constants.md | 7 - .../constants/special-character-constants.md | 23 -- .../constants/special-function-constants.md | 30 --- .../constants/touch-event-constants.md | 37 --- .../constants/widget-options.md | 33 --- .../filesystem/README.md | 2 - .../filesystem/del-file-or-directory.md | 21 -- .../filesystem/dir-directory.md | 24 -- .../filesystem/fstat-path.md | 41 ---- .../README.md | 2 - .../accesstelemetrypush.md | 21 -- .../chdir.md | 14 -- .../crossfiretelemetrypop.md | 17 -- .../crossfiretelemetrypush.md | 18 -- .../defaultchannel.md | 15 -- .../defaultstick.md | 14 -- .../flushaudio.md | 13 - .../getavailablememory.md | 12 - .../getdatetime.md | 20 -- .../getfieldinfo.md | 27 --- .../getflightmode.md | 18 -- .../getgeneralsettings.md | 24 -- .../getglobaltimer.md | 18 -- .../getlogicalswitchvalue-id.md | 13 - .../getoutputvalue-outputindex.md | 12 - .../getras.md | 20 -- .../getrotencmode.md | 14 -- .../getrotencspeed.md | 14 -- .../getrssi.md | 16 -- .../getrtctime.md | 14 -- .../getshmvar-id.md | 17 -- .../getsourceindex-sourcename.md | 19 -- .../getsourcename-sourceindex.md | 17 -- .../getsourcevalue-source.md | 51 ---- .../getswitchindex-positionname.md | 11 - .../getswitchname-switchindex.md | 11 - .../getswitchvalue-switchindex.md | 12 - .../gettime.md | 18 -- .../gettxgps.md | 22 -- .../getusage.md | 14 -- .../getvalue.md | 48 ---- .../getversion.md | 57 ----- .../ghosttelemetrypop.md | 16 -- .../ghosttelemetrypush.md | 17 -- .../grey.md | 18 -- .../killevents.md | 14 -- .../loadscript.md | 49 ---- .../multibuffer.md | 16 -- .../playduration.md | 17 -- .../playfile.md | 18 -- .../playhaptic.md | 18 -- .../playnumber.md | 19 -- .../playtone.md | 21 -- .../popupconfirmation-title-message-event.md | 20 -- .../popupconfirmation.md | 20 -- .../popupinput.md | 24 -- .../popupwarning.md | 19 -- .../resetglobaltimer.md | 20 -- .../serialgetpower-port_nr.md | 14 -- .../serialread.md | 16 -- .../serialsetpower-port_nr-value.md | 16 -- .../serialwrite.md | 16 -- .../setserialbaudrate-baudrate.md | 14 -- .../setserialbaudrate.md | 14 -- .../setshmvar-id-value.md | 18 -- .../setstickyswitch-id-value.md | 15 -- .../settelemetryvalue.md | 25 -- .../sources-first-last.md | 16 -- .../sporttelemetrypop.md | 19 -- .../sporttelemetrypush.md | 20 -- .../switches-first-last.md | 16 -- .../README.md | 2 - .../clear.md | 14 -- .../drawannulus.md | 17 -- .../drawarc.md | 17 -- .../drawbitmap.md | 20 -- .../drawchannel.md | 16 -- .../drawcircle.md | 16 -- .../drawcombobox.md | 25 -- .../drawfilledcircle.md | 16 -- .../drawfilledrectangle.md | 18 -- .../drawfilledtriangle.md | 15 -- .../drawgauge.md | 19 -- .../drawhudrectangle.md | 16 -- .../drawline.md | 21 -- .../drawlinewithclipping.md | 17 -- .../drawnumber.md | 17 -- .../drawpie.md | 17 -- .../drawpixmap.md | 19 -- .../drawpoint.md | 20 -- .../drawrectangle.md | 19 -- .../drawscreentitle.md | 20 -- .../drawsource.md | 16 -- .../drawswitch.md | 16 -- .../drawtext.md | 16 -- .../drawtimer.md | 17 -- .../drawtriangle.md | 15 -- .../getcolor.md | 18 -- .../getlastleftpos.md | 18 -- .../getlastpos.md | 20 -- .../getlastrightpos.md | 20 -- .../lcd.drawbitmappattern-bitmap-x-y-flags.md | 19 -- ...ie-bitmap-x-y-startangle-endangle-flags.md | 21 -- .../lcd.drawtextlines-x-y-w-h-text-flags.md | 20 -- .../lcd.exitfullscreen.md | 10 - .../lcd.invertrect-x-y-w-h-flags.md | 16 -- .../lcd_functions-overview.md | 14 -- .../refresh.md | 16 -- .../resetbacklighttimeout.md | 14 -- .../rgb.md | 21 -- .../setcolor.md | 24 -- .../sizetext.md | 15 -- .../README.md | 2 - .../defaultinputs.md | 14 -- .../deleteflightmodes.md | 14 -- .../deleteinput.md | 15 -- .../deleteinputs.md | 14 -- .../deletemix.md | 15 -- .../deletemixes.md | 14 -- .../getcurve.md | 26 -- .../getcustomfunction.md | 22 -- .../getflightmode.md | 25 -- .../getglobalvariable.md | 25 -- .../getinfo.md | 18 -- .../getinput.md | 26 -- .../getinputscount.md | 14 -- .../getlogicalswitch.md | 21 -- .../getmix.md | 31 --- .../getmixescount.md | 14 -- .../getmodule.md | 49 ---- .../getoutput.md | 25 -- .../getsensor.md | 22 -- .../gettimer.md | 22 -- .../insertinput.md | 16 -- .../insertmix.md | 16 -- .../model.getswashring.md | 21 -- .../model.setswashring-params.md | 17 -- .../resetsensor.md | 14 -- .../resettimer.md | 14 -- .../setcurve.md | 45 ---- .../setcustomfunction.md | 18 -- .../setflightmode.md | 15 -- .../setglobalvariable.md | 18 -- .../setinfo.md | 18 -- .../setlogicalswitch.md | 21 -- .../setmodule.md | 19 -- .../setoutput.md | 19 -- .../settimer.md | 19 -- part_iv_-_advanced_topics/README.md | 4 - .../debugging_techniques.md | 100 -------- .../lua_data_sharing_across_scripts.md | 186 -------------- .../optimization_tricks.md | 27 --- part_iv_-_converting_opentx_20_scripts.md | 6 - part_vi_-_advanced_topics.md | 3 - part_vii_-_appendix.md | 3 - return_statement_syntax.md | 22 -- run_function_syntax.md | 44 ---- telemetry.md | 56 ----- theme_scripts.md | 3 - widget_scripts.md | 110 --------- wizard.md | 5 - 278 files changed, 7779 deletions(-) delete mode 100644 Bitmap/getSize.md delete mode 100644 Bitmap/open.md delete mode 100644 RadioSpecialFunctions.png delete mode 100644 SUMMARY.md delete mode 100644 acknowledgments.md delete mode 100644 debugging_techniques.md delete mode 100644 function_scripts.md delete mode 100644 getting_started.md delete mode 100644 handling_gps_sensor_data.md delete mode 100644 handling_lipo_sensor_data.md delete mode 100644 included_lua_libraries.md delete mode 100644 init_function_syntax.md delete mode 100644 input_table_syntax.md delete mode 100644 introduction.md delete mode 100644 key_events.md delete mode 100644 known_issues.md delete mode 100644 lcd/RGB.md delete mode 100644 lcd/clear.md delete mode 100644 lcd/drawBitmap.md delete mode 100644 lcd/drawChannel.md delete mode 100644 lcd/drawCombobox.md delete mode 100644 lcd/drawFilledRectangle.md delete mode 100644 lcd/drawGauge.md delete mode 100644 lcd/drawLine.md delete mode 100644 lcd/drawNumber.md delete mode 100644 lcd/drawPixmap.md delete mode 100644 lcd/drawPoint.md delete mode 100644 lcd/drawRectangle.md delete mode 100644 lcd/drawScreenTitle.md delete mode 100644 lcd/drawSource.md delete mode 100644 lcd/drawSwitch.md delete mode 100644 lcd/drawText.md delete mode 100644 lcd/drawTimer.md delete mode 100644 lcd/getColor.md delete mode 100644 lcd/getLastLeftPos.md delete mode 100644 lcd/getLastPos.md delete mode 100644 lcd/getLastRightPos.md delete mode 100644 lcd/lcd_functions-overview.md delete mode 100644 lcd/refresh.md delete mode 100644 lcd/resetBacklightTimeout.md delete mode 100644 lcd/setColor.md delete mode 100644 lua_data_sharing_across_scripts.md delete mode 100644 mix.md delete mode 100644 model/defaultInputs.md delete mode 100644 model/deleteFlightModes.md delete mode 100644 model/deleteInput.md delete mode 100644 model/deleteInputs.md delete mode 100644 model/deleteMix.md delete mode 100644 model/deleteMixes.md delete mode 100644 model/getCurve.md delete mode 100644 model/getCustomFunction.md delete mode 100644 model/getFlightMode.md delete mode 100644 model/getGlobalVariable.md delete mode 100644 model/getInfo.md delete mode 100644 model/getInput.md delete mode 100644 model/getInputsCount.md delete mode 100644 model/getLogicalSwitch.md delete mode 100644 model/getMix.md delete mode 100644 model/getMixesCount.md delete mode 100644 model/getModule.md delete mode 100644 model/getOutput.md delete mode 100644 model/getSensor.md delete mode 100644 model/getTimer.md delete mode 100644 model/insertInput.md delete mode 100644 model/insertMix.md delete mode 100644 model/resetSensor.md delete mode 100644 model/resetTimer.md delete mode 100644 model/setCurve.md delete mode 100644 model/setCustomFunction.md delete mode 100644 model/setFlightMode.md delete mode 100644 model/setGlobalVariable.md delete mode 100644 model/setInfo.md delete mode 100644 model/setLogicalSwitch.md delete mode 100644 model/setModule.md delete mode 100644 model/setOutput.md delete mode 100644 model/setTimer.md delete mode 100644 one-time_scripts.md delete mode 100644 optimization_tricks.md delete mode 100644 output_table_syntax.md delete mode 100644 part_i_-_script_type_overview.md delete mode 100644 part_i_-_script_type_overview/README.md delete mode 100644 part_i_-_script_type_overview/function_scripts.md delete mode 100644 part_i_-_script_type_overview/telemetry.md delete mode 100644 part_i_-_script_type_overview/widget_scripts.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/README.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/data-exchange-with-the-edgetx-model-setup.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/drawing-flags-and-colors.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/README.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/bit32.library.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/README.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.close.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.open.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.read.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.seek.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.write.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/math.library.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/string.library.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/init_function_syntax.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/input_table_syntax.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/loading-code-modules-dynamically.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/lua-basics.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/output_table_syntax.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/return_statement_syntax.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/run_function_syntax.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/saving-memory.md delete mode 100644 part_ii_-_opentx_lua_api_programming_guide/using-key-and-touch-events.md delete mode 100644 part_iii_-_opentx_lua_api_reference.md delete mode 100644 part_iii_-_opentx_lua_api_reference/README.md delete mode 100644 part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/README.md delete mode 100644 part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/bitmap.resize-bitmap-width-height.md delete mode 100644 part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/bitmap.tomask-bitmap.md delete mode 100644 part_iii_-_opentx_lua_api_reference/constants/README.md delete mode 100644 part_iii_-_opentx_lua_api_reference/constants/color-constants.md delete mode 100644 part_iii_-_opentx_lua_api_reference/constants/flags-and-pattern-constants.md delete mode 100644 part_iii_-_opentx_lua_api_reference/constants/key_events.md delete mode 100644 part_iii_-_opentx_lua_api_reference/constants/logical-switch-function-constants.md delete mode 100644 part_iii_-_opentx_lua_api_reference/constants/screen-constants.md delete mode 100644 part_iii_-_opentx_lua_api_reference/constants/special-character-constants.md delete mode 100644 part_iii_-_opentx_lua_api_reference/constants/special-function-constants.md delete mode 100644 part_iii_-_opentx_lua_api_reference/constants/touch-event-constants.md delete mode 100644 part_iii_-_opentx_lua_api_reference/constants/widget-options.md delete mode 100644 part_iii_-_opentx_lua_api_reference/filesystem/README.md delete mode 100644 part_iii_-_opentx_lua_api_reference/filesystem/del-file-or-directory.md delete mode 100644 part_iii_-_opentx_lua_api_reference/filesystem/dir-directory.md delete mode 100644 part_iii_-_opentx_lua_api_reference/filesystem/fstat-path.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/README.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/accesstelemetrypush.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/chdir.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/crossfiretelemetrypop.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/crossfiretelemetrypush.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/defaultchannel.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/defaultstick.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/flushaudio.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getavailablememory.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getdatetime.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getfieldinfo.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getflightmode.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getgeneralsettings.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getglobaltimer.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getlogicalswitchvalue-id.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getoutputvalue-outputindex.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getras.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrotencmode.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrotencspeed.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrssi.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrtctime.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getshmvar-id.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getsourceindex-sourcename.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getsourcename-sourceindex.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getsourcevalue-source.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchindex-positionname.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchname-switchindex.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchvalue-switchindex.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/gettime.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/gettxgps.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getusage.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getvalue.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getversion.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/ghosttelemetrypop.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/ghosttelemetrypush.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/grey.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/killevents.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/loadscript.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/multibuffer.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playduration.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playfile.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playhaptic.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playnumber.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playtone.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupconfirmation-title-message-event.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupconfirmation.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupinput.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupwarning.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/resetglobaltimer.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialgetpower-port_nr.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialread.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialsetpower-port_nr-value.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialwrite.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setserialbaudrate-baudrate.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setserialbaudrate.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setshmvar-id-value.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setstickyswitch-id-value.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/settelemetryvalue.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/sources-first-last.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/sporttelemetrypop.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/sporttelemetrypush.md delete mode 100644 part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/switches-first-last.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/README.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/clear.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawannulus.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawarc.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawbitmap.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawchannel.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawcircle.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawcombobox.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawfilledcircle.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawfilledrectangle.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawfilledtriangle.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawgauge.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawhudrectangle.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawline.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawlinewithclipping.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawnumber.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawpie.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawpixmap.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawpoint.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawrectangle.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawscreentitle.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawsource.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawswitch.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawtext.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawtimer.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawtriangle.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getcolor.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getlastleftpos.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getlastpos.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getlastrightpos.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.drawbitmappattern-bitmap-x-y-flags.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.drawbitmappatternpie-bitmap-x-y-startangle-endangle-flags.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.drawtextlines-x-y-w-h-text-flags.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.exitfullscreen.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.invertrect-x-y-w-h-flags.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd_functions-overview.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/refresh.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/resetbacklighttimeout.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/rgb.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/setcolor.md delete mode 100644 part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/sizetext.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/README.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/defaultinputs.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deleteflightmodes.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deleteinput.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deleteinputs.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deletemix.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deletemixes.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getcurve.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getcustomfunction.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getflightmode.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getglobalvariable.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getinfo.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getinput.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getinputscount.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getlogicalswitch.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getmix.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getmixescount.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getmodule.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getoutput.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getsensor.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/gettimer.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/insertinput.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/insertmix.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/model.getswashring.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/model.setswashring-params.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/resetsensor.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/resettimer.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setcurve.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setcustomfunction.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setflightmode.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setglobalvariable.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setinfo.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setlogicalswitch.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setmodule.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setoutput.md delete mode 100644 part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/settimer.md delete mode 100644 part_iv_-_advanced_topics/README.md delete mode 100644 part_iv_-_advanced_topics/debugging_techniques.md delete mode 100644 part_iv_-_advanced_topics/lua_data_sharing_across_scripts.md delete mode 100644 part_iv_-_advanced_topics/optimization_tricks.md delete mode 100644 part_iv_-_converting_opentx_20_scripts.md delete mode 100644 part_vi_-_advanced_topics.md delete mode 100644 part_vii_-_appendix.md delete mode 100644 return_statement_syntax.md delete mode 100644 run_function_syntax.md delete mode 100644 telemetry.md delete mode 100644 theme_scripts.md delete mode 100644 widget_scripts.md delete mode 100644 wizard.md diff --git a/Bitmap/getSize.md b/Bitmap/getSize.md deleted file mode 100644 index 347282bfa..000000000 --- a/Bitmap/getSize.md +++ /dev/null @@ -1,29 +0,0 @@ - - -## Bitmap.getSize(name) - - - -Return width, height of a bitmap object - -@status current Introduced in 2.2.0 - - -#### Parameters - -* `bitmap` (pointer) point to a bitmap previously opened with Bitmap.open() - - - -#### Return value - -* `multiple` returns 2 values: - * (number) width in pixels - * (number) height in pixels - - - -##### Notice -Only available on Horus - - diff --git a/Bitmap/open.md b/Bitmap/open.md deleted file mode 100644 index 45a6c8c3a..000000000 --- a/Bitmap/open.md +++ /dev/null @@ -1,34 +0,0 @@ - - -## Bitmap.open(name) - - - -Loads a bitmap in memory, for later use with lcd.drawBitmap(). Bitmaps should be loaded only -once, returned object should be stored and used for drawing. If loading fails for whatever -reason the resulting bitmap object will have width and height set to zero. - -Bitmap loading can fail if: - * File is not found or contains invalid image - * System is low on memory - * Combined memory usage of all Lua script bitmaps exceeds certain value - -@status current Introduced in 2.2.0 - - -#### Parameters - -* `name` (string) full path to the bitmap on SD card (i.e. “/IMAGES/test.bmp”) - - - -#### Return value - -* `bitmap` (object) a bitmap object that can be used with other bitmap functions - - - -##### Notice -Only available on Horus - - diff --git a/RadioSpecialFunctions.png b/RadioSpecialFunctions.png deleted file mode 100644 index 2823c40a194f2f810d8a68777a2770479fec3d1d..0000000000000000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DdzAJ~wNfo+qpSKK^2@_%wF^&)dmr_lFy@ 0 then - playNumber(minutes, minUnit, 0) - end - if seconds > 0 then - playNumber(seconds, 0, 0) - end - annIndex = annIndex + 1 - end - - if remaining <= 0 then - playNumber(0,0,0) - running = false - end - -end - -return { init=init, run=run } -``` - - diff --git a/getting_started.md b/getting_started.md deleted file mode 100644 index 8e3477675..000000000 --- a/getting_started.md +++ /dev/null @@ -1,16 +0,0 @@ - -### Getting Started - - -#### Downloading OpenTX Companion - -OpenTX Companion 2.2 is available for download at http://www.open-tx.org/downloads.html - - -#### Updating firmware with Lua option selected - -If you intend to use mixer scripts, when updating the firmware on your transmitter you need to make sure the lua option is checked in the settings for your radio profile (Main menu -> Settings ->Settings...) as shown below. This is not required if you only intend to run telemetry, one-time and function scripts, support for those is included by default. - -Also note that the SD Structure path should contain a valid path to a copy of your transmitter's SD card contents, although that's not specific to Lua. - -![Edit Settings dialog from OpenTX Companion](companion-settings.png) \ No newline at end of file diff --git a/handling_gps_sensor_data.md b/handling_gps_sensor_data.md deleted file mode 100644 index ccd3f64f7..000000000 --- a/handling_gps_sensor_data.md +++ /dev/null @@ -1,58 +0,0 @@ -# Handling GPS Sensor data - -#####Overview - -With OpenTx 2.2 it is possible to have multiple GPS sensors, each with their own set of telemetry values which may have user-assigned names. - -Value names are case sensitive and may include some or all of the following: - - GPS (latitude and longitude as a lua table containing [lat] and [lng]) - - GSpd (speed in knots) - - GAlt (altitude in meters) - - Date (gps date converted to local time as a lua table containing [year] [mon] [day] [hour] [min] [sec]) - - Hdg (heading in degrees true) - -This example demonstrates getting latitude and longitude from a sensor with the default name of 'GPS' - -```lua -local gpsValue = "unknown" - -local function rnd(v,d) - if d then - return math.floor((v*10^d)+0.5)/(10^d) - else - return math.floor(v+0.5) - end -end - -local function getTelemetryId(name) - field = getFieldInfo(name) - if field then - return field.id - else - return -1 - end -end - -local function init() - gpsId = getTelemetryId("GPS") -end - -local function background() - gpsLatLon = getValue(gpsId) - if (type(gpsLatLon) == "table") then - gpsValue = rnd(gpsLatLon["lat"],4) .. ", " .. rnd(gpsLatLon["lon"],4) - else - gpsValue = "not currently available" - end -end - -local function run(e) - lcd.clear() - background() -- update current GPS position - lcd.drawText(1,1,"OpenTX 2.2 GPS example",0) - lcd.drawText(1,11,"GPS:", 0) - lcd.drawText(lcd.getLastPos()+2,11,gpsValue,0) -end - -return{init=init,run=run,background=background} -``` diff --git a/handling_lipo_sensor_data.md b/handling_lipo_sensor_data.md deleted file mode 100644 index 2e411f9ee..000000000 --- a/handling_lipo_sensor_data.md +++ /dev/null @@ -1,47 +0,0 @@ -# Handling Lipo Sensor Data -With OpenTx 2.2 it is possible to have multiple Lipo sensors, each with a user-assigned name. The call to getValue() returns a table with the current voltage of each of the cells it is monitoring. - -This example demonstrates getting Lipo cell voltage from a sensor with the default name of 'Cels' - -#####Example: - -```lua -local cellValue = "unknown" -local cellResult = nil -local cellID = nil - -local function getTelemetryId(name) - field = getFieldInfo(name) - if field then - return field.id - else - return -1 - end -end - -local function init() - cellId = getTelemetryId("Cels") -end - -local function background() - cellResult = getValue(cellId) - if (type(cellResult) == "table") then - cellValue = "" - for i, v in ipairs(cellResult) do - cellValue = cellValue .. i .. ": " .. v .. " " - end - else - cellValue = "telemetry not available" - end -end - -local function run(e) - background() - lcd.clear() - lcd.drawText(1,1,"OpenTX 2.2 cell voltage example",0) - lcd.drawText(1,11,"Cels:", 0) - lcd.drawText(lcd.getLastPos()+2,11,cellValue,0) -end - -return{init=init,run=run,background=background} -``` diff --git a/included_lua_libraries.md b/included_lua_libraries.md deleted file mode 100644 index e632a443a..000000000 --- a/included_lua_libraries.md +++ /dev/null @@ -1,16 +0,0 @@ - -# The following Lua libraries are available in OpenTx - - -| Lua Standard Libraries | Included | -| -- | -- | -| package | - | -| coroutine | - | -| table | - | -| [io](lib/io.md) | since OpenTX 2.1.0 (with limitations) | -| os | - | -| string | since OpenTX 2.1.7 | -| bit32 | since OpenTX 2.1.0 | -| math | since OpenTX 2.0.0 | -| debug | - | - diff --git a/init_function_syntax.md b/init_function_syntax.md deleted file mode 100644 index 6f0a76b71..000000000 --- a/init_function_syntax.md +++ /dev/null @@ -1,17 +0,0 @@ -# Init Function Syntax - -If defined, *init* function is called right after the script is loaded from SD card and begins execution. Init is called only once before the run function is called for the first time. - -```lua -local function () - -- code here runs only once when the model is loaded -end -``` - -* #####Input Parameters: -none - -* #####Return values: -none - - diff --git a/input_table_syntax.md b/input_table_syntax.md deleted file mode 100644 index e471a7b2a..000000000 --- a/input_table_syntax.md +++ /dev/null @@ -1,46 +0,0 @@ -# Input Table Syntax - -#####Overview - -The input table defines what values are available as input(s) to [mix scripts](mix.md). There are two forms of input table entries. - -* #####SOURCE syntax -```lua -{ "", SOURCE } -``` -SOURCE inputs provide the current value of a selected OpenTX variable. The source must set by the user when the mix script is configured. Source can be any value OpenTX knows about (inputs, channels, telemetry values, switches, custom functions,...).
-*Note:* typical range is -1024 thru +1024. Simply divide the input value by 10.24 to interpret as a percentage from -100% to +100%. - -* #####VALUE syntax -```lua -{ "", VALUE, , , } -``` -VALUE inputs provide a constant value that is set by the user when the mix script is configured. - * *name* - maximum length of 8 characters - * *min* - minimum value of -128 - * *max* - maximum value of 127 - * *default* - must be within the valid range specified - - -* #####Maximum of 6 inputs per script (warning : was 8 in 2.1) - -#####Example using a SOURCE and a VALUE -```lua -local input = - { - { "Strength", SOURCE}, -- user selects source (typically slider or knob) - { "Interval", VALUE, 0, 100, 0 } -- interval value, default = 0. - } - -local function run(strength, interval) - -- variable strength will contain the current slider value - -- variable interval is set by the user and constant through script lifetime - - -- this script has no return value but may use playFile() to alert user - - return -end - -return {input=input, run=run} -``` - diff --git a/introduction.md b/introduction.md deleted file mode 100644 index 188e352a8..000000000 --- a/introduction.md +++ /dev/null @@ -1,3 +0,0 @@ -# Introduction - -This section includes Acknowledgments and Getting Started. \ No newline at end of file diff --git a/key_events.md b/key_events.md deleted file mode 100644 index 85e8b8f60..000000000 --- a/key_events.md +++ /dev/null @@ -1,74 +0,0 @@ -# Key Events - -This page describes the value that is passed to scripts in the `event` parameter. It is used in [Telemetry](telemetry.md) and [One-Time](one-time_scripts.md) scripts. - -## The key event mechanism - -Each time a key is pressed, held and released a number of events get generated. Here is a typical flow: - * when a key is pressed a `FIRST` event is generated - * if the key continues to be pressed, then after a while a `LONG` event is generated - * if the key continues to be pressed, then a `REPEAT` events are being generated - * when the key is released a `BREAK` event is generated - -Couple of examples: - * a short press on key would generate: `FIRST`, `BREAK` - * a longer pres on key would generate: `FIRST`, `LONG`, `BREAK` - * even longer press: `FIRST`, `LONG`, `REPEAT, `REPEAT, ..., `BREAK` - -This normal key event sequence can be altered with the [killEvents(key)](general/killEvents.md) function. Any time this function is called (after the `FIRST` event) all further key events for this key will be suppressed until the next key press of this key. Examples: - * kill immediately after the key press would generate: `FIRST` - * kill after the long key press would generate: `FIRST`, `LONG` - - -## Constants - -The `event` parameter in the [Telemetry](telemetry.md) and [One-Time](one-time_scripts.md) scripts run function actually carries two pieces of information: - * key number - * type of event - -The two fields are combined into one single number. Some of these combinations are defined as constants and are available to Lua scripts: - -|Key Event Name|Comments| -|:--------:|:-------:| -|EVT_MENU_BREAK| **MENU** key release | -|EVT_PAGE_BREAK| **PAGE** key release | -|EVT_PAGE_LONG| **MENU** key long press | -|EVT_ENTER_BREAK| **ENT** key release | -|EVT_ENTER_LONG| **ENT** key long press| -|EVT_EXIT_BREAK| **EXIT** key release | -|EVT_PLUS_BREAK| **+** key release | -|EVT_MINUS_BREAK| **-** key release | -|EVT_PLUS_FIRST| **+** key press | -|EVT_MINUS_FIRST| **-** key press | -|EVT_PLUS_REPT| **+** key repeat | -|EVT_MINUS_REPT|**-** key repeat| - -Radios with rotary encoder (X7 and Horus) have also: - -|Key Event Name|Comments| -|:--------:|:-------:| -|EVT_ROT_BREAK| rotary encoder release | -|EVT_ROT_LONG| rotary encoder long press | -|EVT_ROT_LEFT| rotary encoder rotated left | -|EVT_ROT_RIGHT| rotary encoder rotated right | - -## Virtual events - -Given the large number of radios supported by OpenTX, and the large difference in keys available on those, a set of VIRTUAL KEYS has been defined and are mapped to best fit available hardware - -|Virtual Key Event Name|Comments| -|:--------:|:-------:| -|EVT_VIRTUAL_NEXT_PAGE| for PAGE navigation | -|EVT_VIRTUAL_PREVIOUS_PAGE| for PAGE navigation | -|EVT_VIRTUAL_ENTER| | -|EVT_VIRTUAL_ENTER_LONG| | -|EVT_VIRTUAL_MENU| | -|EVT_VIRTUAL_MENU_LONG| | -|EVT_VIRTUAL_NEXT| for FIELDS navigation| -|EVT_VIRTUAL_NEXT_REPT| for FIELDS navigation| -|EVT_VIRTUAL_PREVIOUS| for FIELDS navigation| -|EVT_VIRTUAL_PREV_REPT| for FIELDS navigation| -|EVT_VIRTUAL_INC| for VALUES navigation| -|EVT_VIRTUAL_INC_REPT| for VALUES navigation| -|EVT_VIRTUAL_DEC| for VALUES navigation| -|EVT_VIRTUAL_DEC_REPT| for VALUES navigation| \ No newline at end of file diff --git a/known_issues.md b/known_issues.md deleted file mode 100644 index a061ffad9..000000000 --- a/known_issues.md +++ /dev/null @@ -1,21 +0,0 @@ -### General Issues in converting scripts written for OpenTX 2.0 - -#### Deprecated Functions - -**lcd.Lock()** is deprecated, will be obsolete in 2.2. Lua scripts must now explicitly call lcd.Clear() and re-draw the whole display if necessary. - -
-TODO: research killEvents() and use of keys in telemetry scripts -
- -#### Obsolete Telemetry Field Names - -OpenTX since version 2.1 provides more flexibility in the number and type of supported remote sensors. As a result, several field name constants are obsolete and need to be modified in scripts originally written for OpenTX 2.0. - -**GPS field names** are covered in [Handling GPS Sensor Data](handling_gps_sensor_data.md) - -**Lipo voltage field names (LVSS)** are covered in [Handling Lipo Sensor Data](handling_lipo_sensor_data.md) - -#### Maintaining compatibility with OpenTX 2.0 - -**Automatic invocation of the background function** - Beginning in OpenTX 2.1 the background() function is called automatically prior to each invocation of the run() function. Under 2.0 you must explicitly call your background function within your run function. \ No newline at end of file diff --git a/lcd/RGB.md b/lcd/RGB.md deleted file mode 100644 index 18e8dae9a..000000000 --- a/lcd/RGB.md +++ /dev/null @@ -1,31 +0,0 @@ - - -## lcd.RGB(r, g, b) - - - -Returns a 5/6/5 rgb color code, that can be used with lcd.setColor - -@status current Introduced in 2.2.0 - - -#### Parameters - -* `r` (integer) a number between 0x00 and 0xff that expresses te amount of red in the color - -* `g` (integer) a number between 0x00 and 0xff that expresses te amount of green in the color - -* `b` (integer) a number between 0x00 and 0xff that expresses te amount of blue in the color - - - -#### Return value - -* `number` (integer) rgb color expressed in 5/6/5 format - - - -##### Notice -Only available on Colorlcd radios - - diff --git a/lcd/clear.md b/lcd/clear.md deleted file mode 100644 index 3819ca5c1..000000000 --- a/lcd/clear.md +++ /dev/null @@ -1,25 +0,0 @@ - - -## lcd.clear([color]) - - - -Clear the LCD screen - -@status current Introduced in 2.0.0, `color` parameter introduced in 2.2.0 RC12 - - -#### Parameters - -* `color` (optional, only on color screens) - - - -#### Return value - -none - -##### Notice -This function only works in stand-alone and telemetry scripts. - - diff --git a/lcd/drawBitmap.md b/lcd/drawBitmap.md deleted file mode 100644 index adf4fbc61..000000000 --- a/lcd/drawBitmap.md +++ /dev/null @@ -1,30 +0,0 @@ - - -## lcd.drawBitmap(bitmap, x, y [, scale]) - - - -Displays a bitmap at (x,y) - -@status current Introduced in 2.2.0 - - -#### Parameters - -* `bitmap` (pointer) point to a bitmap previously opened with Bitmap.open() - -* `x,y` (positive numbers) starting coordinates - -* `scale` (positive numbers) scale in %, 50 divides size by two, 100 is unchanged, 200 doubles size. -Omitting scale draws image in 1:1 scale and is faster than specifying 100 for scale. - - - -#### Return value - -none - -##### Notice -Only available on Horus - - diff --git a/lcd/drawChannel.md b/lcd/drawChannel.md deleted file mode 100644 index e52518677..000000000 --- a/lcd/drawChannel.md +++ /dev/null @@ -1,26 +0,0 @@ - - -## lcd.drawChannel(x, y, source, flags) - - - -Display a telemetry value at (x,y) - -@status current Introduced in 2.0.6, changed in 2.1.0 (only telemetry sources are valid) - - -#### Parameters - -* `x,y` (positive numbers) starting coordinate - -* `source` can be a source identifier (number) or a source name (string). -See getValue() - -* `flags` (unsigned number) drawing flags - - - -#### Return value - -none - diff --git a/lcd/drawCombobox.md b/lcd/drawCombobox.md deleted file mode 100644 index 2c8814a50..000000000 --- a/lcd/drawCombobox.md +++ /dev/null @@ -1,36 +0,0 @@ - - -## lcd.drawCombobox(x, y, w, list, idx [, flags]) - - - -Draw a combo box - -@status current Introduced in 2.0.0 - - -#### Parameters - -* `x,y` (positive numbers) top left corner position - -* `w` (number) width of combo box in pixels - -* `list` (table) combo box elements, each element is a string - -* `idx` (integer) index of entry to highlight - -* `flags` (unsigned number) drawing flags, the flags can not be combined: - * `BLINK` combo box is expanded - * `INVERS` combo box collapsed, text inversed - * `0 or not present` combo box collapsed, text normal - - - -#### Return value - -none - -##### Notice -Only available on Taranis - - diff --git a/lcd/drawFilledRectangle.md b/lcd/drawFilledRectangle.md deleted file mode 100644 index 977bcdbf4..000000000 --- a/lcd/drawFilledRectangle.md +++ /dev/null @@ -1,27 +0,0 @@ - - -## lcd.drawFilledRectangle(x, y, w, h [, flags]) - - - -Draw a solid rectangle from top left corner (x,y) of specified width and height - -@status current Introduced in 2.0.0 - - -#### Parameters - -* `x,y` (positive numbers) top left corner position - -* `w` (number) width in pixels - -* `h` (number) height in pixels - -* `flags` (unsigned number) drawing flags - - - -#### Return value - -none - diff --git a/lcd/drawGauge.md b/lcd/drawGauge.md deleted file mode 100644 index 30c15eb5d..000000000 --- a/lcd/drawGauge.md +++ /dev/null @@ -1,31 +0,0 @@ - - -## lcd.drawGauge(x, y, w, h, fill, maxfill [, flags]) - - - -Draw a simple gauge that is filled based upon fill value - -@status current Introduced in 2.0.0, changed in 2.2.0 - - -#### Parameters - -* `x,y` (positive numbers) top left corner position - -* `w` (number) width in pixels - -* `h` (number) height in pixels - -* `fill` (number) amount of fill to apply - -* `maxfill` (number) total value of fill - -* `flags` (unsigned number) drawing flags - - - -#### Return value - -none - diff --git a/lcd/drawLine.md b/lcd/drawLine.md deleted file mode 100644 index 389f83d33..000000000 --- a/lcd/drawLine.md +++ /dev/null @@ -1,32 +0,0 @@ - - -## lcd.drawLine(x1, y1, x2, y2, pattern, flags) - - - -Draw a straight line on LCD - -@status current Introduced in 2.0.0, flags introduced in 2.3.6 - - -#### Parameters - -* `x1,y1` (positive numbers) starting coordinate - -* `x2,y2` (positive numbers) end coordinate - -* `pattern` SOLID or DOTTED - -* `flags` lcdflags - - - -#### Return value - -none - -##### Notice -If the start or the end of the line is outside the LCD dimensions, then the -whole line will not be drawn (starting from OpenTX 2.1.5) - - diff --git a/lcd/drawNumber.md b/lcd/drawNumber.md deleted file mode 100644 index 4663035bb..000000000 --- a/lcd/drawNumber.md +++ /dev/null @@ -1,30 +0,0 @@ - - -## lcd.drawNumber(x, y, value [, flags]) - - - -Display a number at (x,y) - -@status current Introduced in 2.0.0, `SHADOWED` introduced in 2.2.1 - - -#### Parameters - -* `x,y` (positive numbers) starting coordinate - -* `value` (number) value to display - -* `flags` (unsigned number) drawing flags: - * `0 or not specified` display with no decimal (like abs()) - * `PREC1` display with one decimal place (number 386 is displayed as 38.6) - * `PREC2` display with tow decimal places (number 386 is displayed as 3.86) - * other general LCD flag also apply - * `SHADOWED` Horus only, apply a shadow effect - - - -#### Return value - -none - diff --git a/lcd/drawPixmap.md b/lcd/drawPixmap.md deleted file mode 100644 index 93ee19e35..000000000 --- a/lcd/drawPixmap.md +++ /dev/null @@ -1,27 +0,0 @@ - - -## lcd.drawPixmap(x, y, name) - - - -Draw a bitmap at (x,y) - -@status current Introduced in 2.0.0 - - -#### Parameters - -* `x,y` (positive numbers) starting coordinates - -* `name` (string) full path to the bitmap on SD card (i.e. “/IMAGES/test.bmp”) - - - -#### Return value - -none - -##### Notice -Maximum image size is [display width / 2] x [display height] pixels. - - diff --git a/lcd/drawPoint.md b/lcd/drawPoint.md deleted file mode 100644 index 2ca9d40e8..000000000 --- a/lcd/drawPoint.md +++ /dev/null @@ -1,31 +0,0 @@ - - -## lcd.drawPoint(x, y) - - - -Draw a single pixel at (x,y) position - -@status current Introduced in 2.0.0 - - -#### Parameters - -* `x` (positive number) x position - -* `y` (positive number) y position - -* `flags` (optional) lcdflags - - - -#### Return value - -none - -##### Notice -Taranis has an LCD display width of 212 pixels and height of 64 pixels. -Position (0,0) is at top left. Y axis is negative, top line is 0, -bottom line is 63. Drawing on an existing black pixel produces white pixel (TODO check this!) - - diff --git a/lcd/drawRectangle.md b/lcd/drawRectangle.md deleted file mode 100644 index cfe87402a..000000000 --- a/lcd/drawRectangle.md +++ /dev/null @@ -1,29 +0,0 @@ - - -## lcd.drawRectangle(x, y, w, h [, flags [, t]]) - - - -Draw a rectangle from top left corner (x,y) of specified width and height - -@status current Introduced in 2.0.0, changed in 2.2.0 - - -#### Parameters - -* `x,y` (positive numbers) top left corner position - -* `w` (number) width in pixels - -* `h` (number) height in pixels - -* `flags` (unsigned number) drawing flags - -* `t` (number) thickness in pixels, defaults to 1 (only on Horus) - - - -#### Return value - -none - diff --git a/lcd/drawScreenTitle.md b/lcd/drawScreenTitle.md deleted file mode 100644 index b54e39a8a..000000000 --- a/lcd/drawScreenTitle.md +++ /dev/null @@ -1,30 +0,0 @@ - - -## lcd.drawScreenTitle(title, page, pages) - - - -Draw a title bar - -@status current Introduced in 2.0.0 - - -#### Parameters - -* `title` (string) text for the title - -* `page` (number) page number - -* `pages` (number) total number of pages. Only used as indicator on -the right side of title bar. (i.e. idx=2, cnt=5, display `2/5`) - - - -#### Return value - -none - -##### Notice -Only available on Taranis - - diff --git a/lcd/drawSource.md b/lcd/drawSource.md deleted file mode 100644 index 6b5ad53d7..000000000 --- a/lcd/drawSource.md +++ /dev/null @@ -1,25 +0,0 @@ - - -## lcd.drawSource(x, y, source [, flags]) - - - -Displays the name of the corresponding input as defined by the source at (x,y) - -@status current Introduced in 2.0.0 - - -#### Parameters - -* `x,y` (positive numbers) starting coordinate - -* `source` (number) source index - -* `flags` (unsigned number) drawing flags - - - -#### Return value - -none - diff --git a/lcd/drawSwitch.md b/lcd/drawSwitch.md deleted file mode 100644 index 83582fac4..000000000 --- a/lcd/drawSwitch.md +++ /dev/null @@ -1,26 +0,0 @@ - - -## lcd.drawSwitch(x, y, switch, flags) - - - -Draw a text representation of switch at (x,y) - -@status current Introduced in 2.0.0 - - -#### Parameters - -* `x,y` (positive numbers) starting coordinate - -* `switch` (number) number of switch to display, negative number -displays negated switch - -* `flags` (unsigned number) drawing flags, only SMLSIZE, BLINK and INVERS. - - - -#### Return value - -none - diff --git a/lcd/drawText.md b/lcd/drawText.md deleted file mode 100644 index 86a2f873e..000000000 --- a/lcd/drawText.md +++ /dev/null @@ -1,35 +0,0 @@ - - -## lcd.drawText(x, y, text [, flags]) - - - -Draw a text beginning at (x,y) - -@status current Introduced in 2.0.0, `SHADOWED` introduced in 2.2.1 - - -#### Parameters - -* `x,y` (positive numbers) starting coordinate - -* `text` (string) text to display - -* `flags` (unsigned number) drawing flags. All values can be -combined together using the + character. ie BLINK + DBLSIZE. -See the [Appendix](../appendix/fonts.md) for available characters in each font set. - * `0 or not specified` normal font - * `XXLSIZE` jumbo sized font - * `DBLSIZE` double size font - * `MIDSIZE` mid sized font - * `SMLSIZE` small font - * `INVERS` inverted display - * `BLINK` blinking text - * `SHADOWED` Horus only, apply a shadow effect - - - -#### Return value - -none - diff --git a/lcd/drawTimer.md b/lcd/drawTimer.md deleted file mode 100644 index a416208b6..000000000 --- a/lcd/drawTimer.md +++ /dev/null @@ -1,29 +0,0 @@ - - -## lcd.drawTimer(x, y, value [, flags]) - - - -Display a value formatted as time at (x,y) - -@status current Introduced in 2.0.0, `SHADOWED` introduced in 2.2.1 - - -#### Parameters - -* `x,y` (positive numbers) starting coordinate - -* `value` (number) time in seconds - -* `flags` (unsigned number) drawing flags: - * `0 or not specified` normal representation (minutes and seconds) - * `TIMEHOUR` display hours - * other general LCD flag also apply - * `SHADOWED` Horus only, apply a shadow effect - - - -#### Return value - -none - diff --git a/lcd/getColor.md b/lcd/getColor.md deleted file mode 100644 index 245dec4d6..000000000 --- a/lcd/getColor.md +++ /dev/null @@ -1,23 +0,0 @@ - - -## lcd.getColor(area) - - - -Get the color for specific area : see lcd.setColor for area list - -@status current Introduced in 2.3.11 - - -#### Parameters - -none - -#### Return value - -none - -##### Notice -Only available on Colorlcd radios - - diff --git a/lcd/getLastLeftPos.md b/lcd/getLastLeftPos.md deleted file mode 100644 index ca0180784..000000000 --- a/lcd/getLastLeftPos.md +++ /dev/null @@ -1,25 +0,0 @@ - - -## lcd.getLastLeftPos() - - - -Returns the leftmost x position from previous drawtext or drawNumber output - -@status current Introduced in 2.2.0 - - -#### Parameters - -none - -#### Return value - -* `number` (integer) x position - - - -##### Notice -Only available on Taranis - - diff --git a/lcd/getLastPos.md b/lcd/getLastPos.md deleted file mode 100644 index c816c8c08..000000000 --- a/lcd/getLastPos.md +++ /dev/null @@ -1,28 +0,0 @@ - - -## lcd.getLastPos() - - - -Returns the rightmost x position from previous output - -@status current Introduced in 2.0.0 - - -#### Parameters - -none - -#### Return value - -* `number` (integer) x position - - - -##### Notice -Only available on Taranis - - -For added clarity, it is recommended to use lcd.getLastRightPos() - - diff --git a/lcd/getLastRightPos.md b/lcd/getLastRightPos.md deleted file mode 100644 index 8394eddbb..000000000 --- a/lcd/getLastRightPos.md +++ /dev/null @@ -1,28 +0,0 @@ - - -## lcd.getLastRightPos() - - - -Returns the rightest x position from previous drawtext or drawNumber output - -@status current Introduced in 2.2.0 - - -#### Parameters - -none - -#### Return value - -* `number` (integer) x position - - - -##### Notice -Only available on Taranis - - -This is strictly equivalent to former lcd.getLastPos() - - diff --git a/lcd/lcd_functions-overview.md b/lcd/lcd_functions-overview.md deleted file mode 100644 index b8e329d39..000000000 --- a/lcd/lcd_functions-overview.md +++ /dev/null @@ -1,57 +0,0 @@ -# Lcd Functions Overview - -##### Description - -Lcd functions allow scripts to interact with the transmitter display. This access is limited to the 'run' functions of One-Time and Telemetry scripts. Widget scripts on the Horus (X10 and X12S) can make use of the lcd functions as well. - -##### 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.** - -Many of the lcd functions accept parameters named *flags* and *patterns*. The names and their meanings are described below. - -#### Flags Constants - -|Name|Description|Version|Notes| -|---|---|---|---| -|0|normal font, default precision for numeric||| -|DBLSIZE|double size font||| -|MIDSIZE|mid sized font||| -|SMLSIZE|small font||| -|INVERS|inverted display||| -|BLINK|blinking text||| -|XXLSIZE|jumbo font|2.0.6|| -|LEFT|left justify|2.0.6| Default for most functions not related to bitmaps| -|RIGHT|right justify||| -|PREC1|single decimal place||| -|PREC2|two decimal places||| -|GREY_DEFAULT|grey fill||| -|TIMEHOUR|dislay hours||Only for drawTimer| - -#### Patterns Constants - -|Name|Description| -|---|---| -|FORCE|pixels will be black| -|ERASE|pixels will be white| -|DOTTED|lines will appear dotted| - -#### Screen Constants - -|Name|Description| -|---|---| -|LCD_W|width in pixels| -|LCD_H|height in pixels| - -#### Screen Information - -| Radio | LCD_W | LCD_H | Colours | -| --- | --- | --- | --- | -| X7 | 128 | 64 | 1 bit | -| X9D | 212 | 64 | 4 bit | -| X9D+ | 212 | 64 | 4 bit | -| X9E | 212 | 64 | 4 bit | -| X10 | 480 | 272 | RGB565 | -| X12S | 480 | 272 | RGB565 | - - diff --git a/lcd/refresh.md b/lcd/refresh.md deleted file mode 100644 index 11364125d..000000000 --- a/lcd/refresh.md +++ /dev/null @@ -1,23 +0,0 @@ - - -## lcd.refresh() - - - -Refresh the LCD screen - -@status current Introduced in 2.2.0 - - -#### Parameters - -none - -#### Return value - -none - -##### Notice -This function only works in stand-alone and telemetry scripts. - - diff --git a/lcd/resetBacklightTimeout.md b/lcd/resetBacklightTimeout.md deleted file mode 100644 index 391393c79..000000000 --- a/lcd/resetBacklightTimeout.md +++ /dev/null @@ -1,19 +0,0 @@ - - -## lcd.resetBacklightTimeout() - - - -Reset the backlight timeout - -@status current Introduced in 2.3.6 - - -#### Parameters - -none - -#### Return value - -none - diff --git a/lcd/setColor.md b/lcd/setColor.md deleted file mode 100644 index 4359303f6..000000000 --- a/lcd/setColor.md +++ /dev/null @@ -1,68 +0,0 @@ - - -## lcd.setColor(area, color) - - - -Set a color for specific area - -@status current Introduced in 2.2.0 - - -#### Parameters - -* `area` (unsigned number) specific screen area in the list bellow - * `CUSTOM_COLOR` - * `DEFAULT_COLOR` - * `DEFAULT_BGCOLOR` - * `FOCUS_COLOR` - * `FOCUS_BGCOLOR` - * `LINE_COLOR` - * `CHECKBOX_COLOR` - * `MENU_BGCOLOR` - * `MENU_COLOR` - * `MENU_TITLE_DISABLE_COLOR` - * `HEADER_COLOR` - * `ALARM_COLOR` - * `HIGHLIGHT_COLOR` - * `TEXT_DISABLE_COLOR` - * `HEADER_COLOR` - * `DISABLE_COLOR` - * `CURVE_CURSOR_COLOR` - * `TITLE_BGCOLOR` - * `TRIM_BGCOLOR` - * `TRIM_SHADOW_COLOR` - * `MAINVIEW_PANES_COLOR` - * `MAINVIEW_GRAPHICS_COLOR` - * `MENU_BGCOLOR` - * `HEADER_ICON_BGCOLOR` - * `HEADER_CURRENT_BGCOLOR` - * `MAINVIEW_PANES_COLOR` - * `MAINVIEW_GRAPHICS_COLOR` - * `OVERLAY_COLOR` - * `BARGRAPH1_COLOR` - * `BARGRAPH2_COLOR` - * `BARGRAPH_BGCOLOR` - * `CUSTOM_COLOR` - -* `color` (number) color in 5/6/5 rgb format. The following prefined colors are available - * `WHITE` - * `GREY` - * `LIGHTGREY` - * `DARKGREY` - * `BLACK` - * `YELLOW` - * `BLUE` - * `RED` - * `DARKRED` - - - -#### Return value - -none - -##### Notice -Only available on Colorlcd radios - - diff --git a/lua_data_sharing_across_scripts.md b/lua_data_sharing_across_scripts.md deleted file mode 100644 index 1f04a5f04..000000000 --- a/lua_data_sharing_across_scripts.md +++ /dev/null @@ -1,178 +0,0 @@ -# Lua data sharing across scripts - -#####Overview: -OpenTX considers all function, mix, and telemetry scripts to be 'permanent' scripts that share the same runtime environment. They are typically loaded at power up or when a new model is selected. However, they are also reinitialized when a script is added or removed during model editing. - -#####Lua scoping rules: -Any variable or function not declared local is implicitly global. Care must be taken to avoid unintentional global declarations, and ensure that the globals you intentionally declare have unique names to avoid conflicts with scripts written by others. - -#####Example: -This example consists of three scripts -- **count-dn.lua** - this is a mix script than can be run stand alone to announce time remaining based on a user-defined switch and duration. It updates two global variables (gCountUp and gCountDown). It also creates output values (ctup and ctdn) which are for demonstration purposes only. -- **count-up.lua** - this is an optional function script which will do count up announcements based on harded coded values. -- **shocount.lua** - this is an optional telemetry script which simply shows the current values of the gCountUp and gCountDown variables. - -#####Installation: - - count-dn.lua - - copy to /SCRIPTS/MIXES - - configure on the transmitter CUSTOM SCRIPT page - - suggested switch = "SA" - - suggested mins = 3 - - suggested sw_high = 0 - - screen image: -![count-dn.lua mix script](count-dn.png) - - - - count-up.lua - - copy to /SCRIPTS/FUNCTIONS - - configure on the transmitter SPECIAL FUNCTIONS page - - suggested switch SA(down) - - screen image: -![count-up.lua function script](count-up.png) - - - - shocount.lua - - copy to /SCRIPTS/TELEMETRY - - configure on the transmitter TELEMETRY page - - screen image: -![shocount.lua function script](shocount.png) - -#####Script sources: - -######count-dn.lua -```lua --- these globals can be referenced in function and telemetry scripts -gCountUp = 0 -gCountDown = 0 - -local target -local running = false -local complete = false -local announcements = { 720, 660, 600, 540, 480, 420, 360, 300, 240, 180, 120, 105, 90, 75, 60, 55, 50, 45, 40, 35, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0} -local annIndex -- index into the announcements table (1 based) -local minUnit -- used by playNumber() for unit announcement - -local input = - { - { "switch", SOURCE}, -- switch used to activate count down - { "mins", VALUE, 1, 12, 2 }, -- minutes to count down - { "sw_high", VALUE, 0, 1, 1 } -- 0 = active when low, otherwise active when high - } - -local output = {"ctup", "ctdn" } - -local function init() - local version = getVersion() - if version < "2.1" then - minUnit = 16 -- unit for minutes in OpenTX 2.0 - elseif version < "2.2" then - minUnit = 23 -- unit for minutes in OpenTX 2.1 - else - minUnit = 25 -- unit for minutes in OpenTX 2.2 - end -end - -local function countdownIsRunning(switch, sw_high) - -- evaluate switch - return true if we should be counting down - if (sw_high > 0) then - return (switch > -1000) - else - return (switch < 1000) - end -end - -local function run(switch, mins, sw_high) - local timenow = getTime() -- 10ms tick count - local minutes - local seconds - - if (not countdownIsRunning(switch, sw_high)) then - running = false - complete = false - return 0, 0 -- ***** NOTE: early exit ***** - end - - if (complete) then - return 0, 0 -- must reset the switch before we go again - end - - if (not running) then - running = true - target = timenow + ((mins * 60) * 100) - annIndex = 1 - end - - gCountDown = math.floor(((target - timenow) / 100) + .7) -- + is adj. to for announcement lag - gCountUp = (mins * 60) - gCountDown - - while gCountDown < announcements[annIndex] do - annIndex = annIndex + 1 -- catch up - end - - if gCountDown == announcements[annIndex] then - minutes = math.floor(gCountDown / 60) - seconds = gCountDown % 60 - if minutes > 0 then - playNumber(minutes, minUnit, 0) - end - if seconds > 0 then - playNumber(seconds, 0, 0) - end - annIndex = annIndex + 1 - end - - if gCountDown <= 0 then - playNumber(0,0,0) - running = false - gCountDown = 0 - complete = true - end - - return gCountUp * 10.24, gCountDown * 10.24 -end - -return { input=input, output=output, init=init, run=run } -``` - -######count-up.lua -```lua -gCountUp = 0 - -local min = 5 -local max = 30 -local last = 0 -local announcements = { 5, 10, 15, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 } -local annIndex = 1 - -local function run(e) - if not (gCountUp == last) then - last = gCountUp - for key, value in pairs(announcements) do - if value == last then - playNumber(last, 0, 0) - end - end - end -end - -return{run=run} -``` - -######shocount.lua -```lua --- these globals can be referenced in mix, function, and telemetry scripts -gCountUp = 0 -gCountDown = 0 - -local function run(e) - lcd.clear() - lcd.drawText(1,1,"OpenTx Lua Data Sharing",0) - - lcd.drawText(1,11,"gCountUp:", 0) - lcd.drawText(lcd.getLastPos()+2,11,gCountUp,0) - lcd.drawText(1, 21, "gCountDown:", 0) - lcd.drawText(lcd.getLastPos()+2,21,gCountDown,0) -end - -return{run=run} -``` diff --git a/mix.md b/mix.md deleted file mode 100644 index 495306035..000000000 --- a/mix.md +++ /dev/null @@ -1,86 +0,0 @@ -# Mix Scripts - -***WARNING - *** -**Do not use Lua mix scripts for controlling any aspect of your model that could cause a crash if script stops executing.** - -## Description - -Each model can have several mix scripts associated with it. These scripts are run periodically for entire time that model is selected. These scripts behave similar to standard OpenTX mixers but at the same time provide much more flexible and powerful tool. - -Mix scripts take one or more values as inputs, do some calculation or logic processing based on them and output one or more values. Each run of a script should be as short as possible. Exceeding the script execution runtime limit will result in the script being forcefully stopped and disabled. - - -## Typical uses - -* replacement for complex mixes that are not critical to model function -* complex processing of inputs and reaction to their current state and/or their history -* filtering of telemetry values - -## Limitations - -* cannot update LCD screen or perform user input. -* should not exceed allowed run-time/ number of instructions. -* mix scripts are run with less priority than built-in mixes. Their execution period is around 30ms and is not guaranteed! -* can be disabled/killed anytime due to logic errors in script, not enough free memory, etc...) - -## Location - -Place them on SD card in folder /SCRIPTS/MIXES/. File name length (without extension) **must be 6 characters or less** (this limit was 8 characters in OpenTX 2.1). - -## Lifetime - -* script is loaded from SD card when model is selected -* script *init* function is called -* script *run* function is periodically called (inside GUI thread, period cca 30ms) -* script is killed (stopped and disabled) if it misbehaves (too long runtime, error in code, low memory) -* all mix scripts are stopped while one-time script is running (see Lua One-time scripts) - -### Disabled script - -If as script output is used as a `mixer source` and the script is killed for what ever reason, then `the whole mixer line is disabled`! This can be used for example to provide a fall-back in case Lua mixer script gets killed. - -Example where Lua mix script is used to drive ailerons in some clever way, but -control falls back to the standard aileron mix if script is killed. Second mixer line replaces the first one when the script is alive: -``` -CH1 [I4]Ail Weight(+100%) - := LUA4b Weight(+100%) -``` - - - -## Script interface definition - -Every script must include a *return* statement at the end, that defines its interface to the rest of OpenTX code. This statement defines: -* script *input* table (optional, see [Input Table Syntax](input_table_syntax.md)) -* script *output* table (optional, see [Output Table Syntax](output_table_syntax.md)) -* script *init* function (optional, see [Init Function Syntax](init_function_syntax.md)) -* script *run* function (see [Run Function Syntax](run_function_syntax.md)) - -### Example (interface only): -```lua -local input {} - -local output {} - -local function init_func() -end - -local function run_func() -end - -return { input=input, output=output, run=run_func, init=init_func } -``` - -### Notes: -* inputs table defines input parameters (name and source) to run function ([see Input Table Syntax](input_table_syntax.md)) -* outputs table defines names for values returned by run function (see [Output Table Syntax](output_table_syntax.md)) -* init_func() function is called once when script is loaded. -* run_func() function is called periodically - - - - - - - - diff --git a/model/defaultInputs.md b/model/defaultInputs.md deleted file mode 100644 index f878dbbc4..000000000 --- a/model/defaultInputs.md +++ /dev/null @@ -1,19 +0,0 @@ - - -## model.defaultInputs() - - - -Set all inputs to defaults - -@status current Introduced in 2.0.0 - - -#### Parameters - -none - -#### Return value - -none - diff --git a/model/deleteFlightModes.md b/model/deleteFlightModes.md deleted file mode 100644 index ae7105974..000000000 --- a/model/deleteFlightModes.md +++ /dev/null @@ -1,19 +0,0 @@ - - -## model.deleteFlightModes() - - - -Clear all flightModes - -@status current Introduced in 2.3.10 - - -#### Parameters - -none - -#### Return value - -none - diff --git a/model/deleteInput.md b/model/deleteInput.md deleted file mode 100644 index 13dfb79cb..000000000 --- a/model/deleteInput.md +++ /dev/null @@ -1,23 +0,0 @@ - - -## model.deleteInput(input, line) - - - -Delete line from specified input - -@status current Introduced in 2.0.0 - - -#### Parameters - -* `input` (unsigned number) input number (use 0 for Input1) - -* `line` (unsigned number) input line (use 0 for first line) - - - -#### Return value - -none - diff --git a/model/deleteInputs.md b/model/deleteInputs.md deleted file mode 100644 index 8e6d76f0b..000000000 --- a/model/deleteInputs.md +++ /dev/null @@ -1,19 +0,0 @@ - - -## model.deleteInputs() - - - -Delete all Inputs - -@status current Introduced in 2.0.0 - - -#### Parameters - -none - -#### Return value - -none - diff --git a/model/deleteMix.md b/model/deleteMix.md deleted file mode 100644 index 210a9d16f..000000000 --- a/model/deleteMix.md +++ /dev/null @@ -1,23 +0,0 @@ - - -## model.deleteMix(channel, line) - - - -Delete mixer line from specified Channel - -@status current Introduced in 2.0.0 - - -#### Parameters - -* `channel` (unsigned number) channel number (use 0 for CH1) - -* `line` (unsigned number) mix number (use 0 for first line(mix)) - - - -#### Return value - -none - diff --git a/model/deleteMixes.md b/model/deleteMixes.md deleted file mode 100644 index c57bce39f..000000000 --- a/model/deleteMixes.md +++ /dev/null @@ -1,19 +0,0 @@ - - -## model.deleteMixes() - - - -Remove all mixers - -@status current Introduced in 2.0.0 - - -#### Parameters - -none - -#### Return value - -none - diff --git a/model/getCurve.md b/model/getCurve.md deleted file mode 100644 index c7932c2ac..000000000 --- a/model/getCurve.md +++ /dev/null @@ -1,38 +0,0 @@ - - -## model.getCurve(curve) - - - -Get Curve parameters - - Note that functions returns the tables starting with index 0 contrary to LUA's - usual index starting with 1 - -@status current Introduced in 2.0.12 - - -#### Parameters - -* `curve` (unsigned number) curve number (use 0 for Curve1) - - - -#### Return value - -* `nil` requested curve does not exist - -* `table` curve data: - * `name` (string) name - * `type` (number) type - * `smooth` (boolean) smooth - * `points` (number) number of points - * `y` (table) table of Y values: - * `key` is point number (zero based) - * `value` is y value - * `x` (table) **only included for custom curve type**: - * `key` is point number (zero based) - * `value` is x value - - - diff --git a/model/getCustomFunction.md b/model/getCustomFunction.md deleted file mode 100644 index ffc01394b..000000000 --- a/model/getCustomFunction.md +++ /dev/null @@ -1,32 +0,0 @@ - - -## model.getCustomFunction(function) - - - -Get Custom Function parameters - -@status current Introduced in 2.0.0, TODO rename function - - -#### Parameters - -* `function` (unsigned number) custom function number (use 0 for CF1) - - - -#### Return value - -* `nil` requested custom function does not exist - -* `table` custom function data: - * `switch` (number) switch index - * `func` (number) function index - * `name` (string) Name of track to play (only returned only returned if action is play track, sound or script) - * `value` (number) value (only returned only returned if action is **not** play track, sound or script) - * `mode` (number) mode (only returned only returned if action is **not** play track, sound or script) - * `param` (number) parameter (only returned only returned if action is **not** play track, sound or script) - * `active` (number) 0 = disabled, 1 = enabled - - - diff --git a/model/getFlightMode.md b/model/getFlightMode.md deleted file mode 100644 index 90fd28113..000000000 --- a/model/getFlightMode.md +++ /dev/null @@ -1,35 +0,0 @@ - - -## model.getFlightMode(index) - - - -Return input data for given input and line number - -@status current Introduced in 2.3.10 - - -#### Parameters - -* `index` (unsigned number) flight mode number (use 0 for FM0) - - - -#### Return value - -* `nil` requested input or line does not exist - -* `table` input data: - * `name` (string) input line name - * `switch` (number) input switch index - * `fadeIn` (number) fade in value (in 0.1s) - * `fadeOut` (number) fade out value (in 0.1s) - * `trimsValues` (table) table of trim values: - * `key` is trim number (zero based) - * `value` is trim value - * `trimsModes` (table) table of trim mode: - * `key` is trim number (zero based) - * `value` is trim mode - - - diff --git a/model/getGlobalVariable.md b/model/getGlobalVariable.md deleted file mode 100644 index 13ef46226..000000000 --- a/model/getGlobalVariable.md +++ /dev/null @@ -1,36 +0,0 @@ - - -## model.getGlobalVariable(index, flight_mode) - - - -Return current global variable value - -Example: - -```lua - -- get GV3 (index = 2) from Flight mode 0 (FM0) - val = model.getGlobalVariable(2, 0) -``` - - -#### Parameters - -* `index` zero based global variable index, use 0 for GV1, 8 for GV9 - -* `flight_mode` Flight mode number (0 = FM0, 8 = FM8) - - - -#### Return value - -* `nil` requested global variable does not exist - -* `number` current value of global variable - - - -##### Notice -a simple warning or notice - - diff --git a/model/getInfo.md b/model/getInfo.md deleted file mode 100644 index 4b86bb536..000000000 --- a/model/getInfo.md +++ /dev/null @@ -1,23 +0,0 @@ - - -## model.getInfo() - - - -Get current Model information - -@status current Introduced in 2.0.6, changed in 2.2.0 - - -#### Parameters - -none - -#### Return value - -* `table` model information: - * `name` (string) model name - * `bitmap` (string) bitmap name (not present on X7) - - - diff --git a/model/getInput.md b/model/getInput.md deleted file mode 100644 index ec544ede9..000000000 --- a/model/getInput.md +++ /dev/null @@ -1,37 +0,0 @@ - - -## model.getInput(input, line) - - - -Return input data for given input and line number - -@status current Introduced in 2.0.0, curveType/curveValue/carryTrim added in 2.3, inputName added 2.3.10, flighmode reworked in 2.3.11 - - -#### Parameters - -* `input` (unsigned number) input number (use 0 for Input1) - -* `line` (unsigned number) input line (use 0 for first line) - - - -#### Return value - -* `nil` requested input or line does not exist - -* `table` input data: - * `name` (string) input line name - * `inputName` (string) input input name - * `source` (number) input source index - * `weight` (number) input weight - * `offset` (number) input offset - * `switch` (number) input switch index - * `curveType` (number) curve type (function, expo, custom curve) - * `curveValue` (number) curve index - * `carryTrim` (boolean) input trims applied - * 'flightModes' (number) bit-mask of active flight modes - - - diff --git a/model/getInputsCount.md b/model/getInputsCount.md deleted file mode 100644 index 60ad9d13a..000000000 --- a/model/getInputsCount.md +++ /dev/null @@ -1,23 +0,0 @@ - - -## model.getInputsCount(input) - - - -Return number of lines for given input - -@status current Introduced in 2.0.0 - - -#### Parameters - -* `input` (unsigned number) input number (use 0 for Input1) - - - -#### Return value - -* `number` number of configured lines for given input - - - diff --git a/model/getLogicalSwitch.md b/model/getLogicalSwitch.md deleted file mode 100644 index 7d7b93c74..000000000 --- a/model/getLogicalSwitch.md +++ /dev/null @@ -1,32 +0,0 @@ - - -## model.getLogicalSwitch(switch) - - - -Get Logical Switch parameters - -@status current Introduced in 2.0.0 - - -#### Parameters - -* `switch` (unsigned number) logical switch number (use 0 for LS1) - - - -#### Return value - -* `nil` requested logical switch does not exist - -* `table` logical switch data: - * `func` (number) function index - * `v1` (number) V1 value (index) - * `v2` (number) V2 value (index or value) - * `v3` (number) V3 value (index or value) - * `and` (number) AND switch index - * `delay` (number) delay (time in 1/10 s) - * `duration` (number) duration (time in 1/10 s) - - - diff --git a/model/getMix.md b/model/getMix.md deleted file mode 100644 index 4615f9bf2..000000000 --- a/model/getMix.md +++ /dev/null @@ -1,42 +0,0 @@ - - -## model.getMix(channel, line) - - - -Get configuration for specified Mix - -@status current Introduced in 2.0.0, parameters below `multiplex` added in 2.0.13 - - -#### Parameters - -* `channel` (unsigned number) channel number (use 0 for CH1) - -* `line` (unsigned number) mix number (use 0 for first line(mix)) - - - -#### Return value - -* `nil` requested channel or line does not exist - -* `table` mix data: - * `name` (string) mix line name - * `source` (number) source index - * `weight` (number) weight (1024 == 100%) value or GVAR1..9 = 4096..4011, -GVAR1..9 = 4095..4087 - * `offset` (number) offset value or GVAR1..9 = 4096..4011, -GVAR1..9 = 4095..4087 - * `switch` (number) switch index - * `multiplex` (number) multiplex (0 = ADD, 1 = MULTIPLY, 2 = REPLACE) - * `curveType` (number) curve type (function, expo, custom curve) - * `curveValue` (number) curve index - * `flightModes` (number) bit-mask of active flight modes - * `carryTrim` (boolean) carry trim - * `mixWarn` (number) warning (0 = off, 1 = 1 beep, .. 3 = 3 beeps) - * `delayUp` (number) delay up (time in 1/10 s) - * `delayDown` (number) delay down - * `speedUp` (number) speed up - * `speedDown` (number) speed down - - - diff --git a/model/getMixesCount.md b/model/getMixesCount.md deleted file mode 100644 index 5eca8ce77..000000000 --- a/model/getMixesCount.md +++ /dev/null @@ -1,23 +0,0 @@ - - -## model.getMixesCount(channel) - - - -Get the number of Mixer lines that the specified Channel has - -@status current Introduced in 2.0.0 - - -#### Parameters - -* `channel` (unsigned number) channel number (use 0 for CH1) - - - -#### Return value - -* `number` number of mixes for requested channel - - - diff --git a/model/getModule.md b/model/getModule.md deleted file mode 100644 index 9f8917969..000000000 --- a/model/getModule.md +++ /dev/null @@ -1,57 +0,0 @@ - - -## model.getModule(index) - - - -Get RF module parameters - -`Type` values: - * 0 NONE - * 1 PPM - * 2 XJT_PXX1 - * 3 ISRM_PXX2 - * 4 DSM2 - * 5 CROSSFIRE - * 6 MULTIMODULE - * 7 R9M_PXX1 - * 8 R9M_PXX2 - * 9 R9M_LITE_PXX1 - * 10 R9M_LITE_PXX2 - * 11 R9M_LITE_PRO_PXX1 - * 12 R9M_LITE_PRO_PXX2 - * 13 SBUS - * 14 XJT_LITE_PXX2 - -`subType` values for XJT_PXX1: - * -1 OFF - * 0 D16 - * 1 D8 - * 2 LR12 - -@status current Introduced in 2.2.0 - - -#### Parameters - -* `index` (number) module index (0 for internal, 1 for external) - - - -#### Return value - -* `nil` requested module does not exist - -* `table` module parameters: - * `subType` (number) protocol index - * `modelId` (number) receiver number - * `firstChannel` (number) start channel (0 is CH1) - * `channelsCount` (number) number of channels sent to module - * `Type` (number) module type - * if the module type is Multi additional information are available - * `protocol` (number) protocol number (Multi only) - * `subProtocol` (number) sub-protocol number (Multi only) - * `channelsOrder` (number) first 4 channels expected order (Multi only) - - - diff --git a/model/getOutput.md b/model/getOutput.md deleted file mode 100644 index 79c1b170f..000000000 --- a/model/getOutput.md +++ /dev/null @@ -1,35 +0,0 @@ - - -## model.getOutput(index) - - - -Get servo parameters - -@status current Introduced in 2.0.0 - - -#### Parameters - -* `index` (unsigned number) output number (use 0 for CH1) - - - -#### Return value - -* `nil` requested output does not exist - -* `table` output parameters: - * `name` (string) name - * `min` (number) Minimum % * 10 - * `max` (number) Maximum % * 10 - * `offset` (number) Subtrim * 10 - * `ppmCenter` (number) offset from PPM Center. 0 = 1500 - * `symetrical` (number) linear Subtrim 0 = Off, 1 = On - * `revert` (number) irection 0 = ­­­---, 1 = INV - * `curve` - * (number) Curve number (0 for Curve1) - * or `nil` if no curve set - - - diff --git a/model/getSensor.md b/model/getSensor.md deleted file mode 100644 index f5d9ca662..000000000 --- a/model/getSensor.md +++ /dev/null @@ -1,32 +0,0 @@ - - -## model.getSensor(sensor) - - - -Get Telemetry Sensor parameters - -@status current Introduced in 2.3.0 - - -#### Parameters - -* `sensor` (unsigned number) sensor number (use 0 for sensor 1) - - - -#### Return value - -* `nil` requested sensor does not exist - -* `table` with sensor data: - * `type` (number) 0 = custom, 1 = calculated - * `name` (string) Name - * `unit` (number) See list of units in the appendix of the OpenTX Lua Reference Guide - * `prec` (number) Number of decimals - * `id` (number) Only custom sensors - * `instance` (number) Only custom sensors - * `formula` (number) Only calculated sensors. 0 = Add etc. see list of formula choices in Companion popup - - - diff --git a/model/getTimer.md b/model/getTimer.md deleted file mode 100644 index 57a4053b5..000000000 --- a/model/getTimer.md +++ /dev/null @@ -1,32 +0,0 @@ - - -## model.getTimer(timer) - - - -Get model timer parameters - -@status current Introduced in 2.0.0, name added in 2.3.6 - - -#### Parameters - -* `timer` (number) timer index (0 for Timer 1) - - - -#### Return value - -* `nil` requested timer does not exist - -* `table` timer parameters: - * `mode` (number) timer trigger source: off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw - * `start` (number) start value [seconds], 0 for up timer, 0> down timer - * `value` (number) current value [seconds] - * `countdownBeep` (number) countdown beep (0­ = silent, 1 =­ beeps, 2­ = voice) - * `minuteBeep` (boolean) minute beep - * `persistent` (number) persistent timer - * `name` (string) timer name - - - diff --git a/model/insertInput.md b/model/insertInput.md deleted file mode 100644 index 1746aba4b..000000000 --- a/model/insertInput.md +++ /dev/null @@ -1,25 +0,0 @@ - - -## model.insertInput(input, line, value) - - - -Insert an Input at specified line - -@status current Introduced in 2.0.0, curveType/curveValue/carryTrim added in 2.3, inputName added 2.3.10 - - -#### Parameters - -* `input` (unsigned number) input number (use 0 for Input1) - -* `line` (unsigned number) input line (use 0 for first line) - -* `value` (table) input data, see model.getInput() - - - -#### Return value - -none - diff --git a/model/insertMix.md b/model/insertMix.md deleted file mode 100644 index a7955cdde..000000000 --- a/model/insertMix.md +++ /dev/null @@ -1,25 +0,0 @@ - - -## model.insertMix(channel, line, value) - - - -Insert a mixer line into Channel - -@status current Introduced in 2.0.0, parameters below `multiplex` added in 2.0.13 - - -#### Parameters - -* `channel` (unsigned number) channel number (use 0 for CH1) - -* `line` (unsigned number) mix number (use 0 for first line(mix)) - -* `value` (table) see model.getMix() for table format - - - -#### Return value - -none - diff --git a/model/resetSensor.md b/model/resetSensor.md deleted file mode 100644 index 1c64e4bee..000000000 --- a/model/resetSensor.md +++ /dev/null @@ -1,21 +0,0 @@ - - -## model.resetSensor(sensor) - - - -Reset Telemetry Sensor parameters - -@status current Introduced in 2.3.11 - - -#### Parameters - -* `sensor` (unsigned number) sensor number (use 0 for sensor 1) - - - -#### Return value - -* `nil` - diff --git a/model/resetTimer.md b/model/resetTimer.md deleted file mode 100644 index c63b6e0f2..000000000 --- a/model/resetTimer.md +++ /dev/null @@ -1,21 +0,0 @@ - - -## model.resetTimer(timer) - - - -Reset model timer to a startup value - -@status current Introduced in TODO - - -#### Parameters - -* `timer` (number) timer index (0 for Timer 1) - - - -#### Return value - -none - diff --git a/model/setCurve.md b/model/setCurve.md deleted file mode 100644 index 0cb316a1b..000000000 --- a/model/setCurve.md +++ /dev/null @@ -1,51 +0,0 @@ - - -## model.setCurve(curve, params) - - - -Set Curve parameters - -The first and last x value must -100 and 100 and x values must be monotonically increasing - -@status current Introduced in 2.2.0 - -Example setting a 4-point custom curve: -```lua - params = {} - params["x"] = {-100, -34, 77, 100} - params["y"] = {-70, 20, -89, -100} - params["smooth"] = true - params["type"] = 1 - val = model.setCurve(2, params) - ``` -setting a 6-point standard smoothed curve - ```lua - val = model.setCurve(3, {smooth=true, y={-100, -50, 0, 50, 100, 80}}) - ``` - - - -#### Parameters - -* `curve` (unsigned number) curve number (use 0 for Curve1) - -* `params` see model.getCurve return format for table format. setCurve uses standard - lua array indexing and arrays start at index 1 - - - -#### Return value - -* `` 0 - Everything okay - 1 - Wrong number of points - 2 - Invalid Curve number - 3 - Cuve does not fit anymore - 4 - point of out of index - 5 - x value not monotonically increasing - 6 - y value not in range [-100;100] - 7 - extra values for y are set - 8 - extra values for x are set - - - diff --git a/model/setCustomFunction.md b/model/setCustomFunction.md deleted file mode 100644 index a9e8577d5..000000000 --- a/model/setCustomFunction.md +++ /dev/null @@ -1,28 +0,0 @@ - - -## model.setCustomFunction(function, value) - - - -Set Custom Function parameters - -@status current Introduced in 2.0.0, TODO rename function - - -#### Parameters - -* `function` (unsigned number) custom function number (use 0 for CF1) - -* `value` (table) custom function parameters, see model.getCustomFunction() for table format - - - -#### Return value - -none - -##### Notice -If a parameter is missing from the value, then -that parameter remains unchanged. - - diff --git a/model/setFlightMode.md b/model/setFlightMode.md deleted file mode 100644 index 1951ed7d8..000000000 --- a/model/setFlightMode.md +++ /dev/null @@ -1,23 +0,0 @@ - - -## model.setFlightMode(index, params) - - - -Set Flight mode parameters - -@status current Introduced in 2.3.10 - - -#### Parameters - -* `index` (unsigned number) flight mode number (use 0 for FM0) - -* `params` see model.getFlightMode return format for table format. - - - -#### Return value - -none - diff --git a/model/setGlobalVariable.md b/model/setGlobalVariable.md deleted file mode 100644 index bc2f3dd57..000000000 --- a/model/setGlobalVariable.md +++ /dev/null @@ -1,30 +0,0 @@ - - -## model.setGlobalVariable(index, flight_mode, value) - - - -Sets current global variable value. See also model.getGlobalVariable() - - -#### Parameters - -* `index` zero based global variable index, use 0 for GV1, 8 for GV9 - -* `flight_mode` Flight mode number (0 = FM0, 8 = FM8) - -* `value` new value for global variable. Permitted range is -from -1024 to 1024. - - - -#### Return value - -none - -##### Notice -Global variable can only store integer values, -any floating point value is converted into integer value -by truncating everything behind a floating point. - - diff --git a/model/setInfo.md b/model/setInfo.md deleted file mode 100644 index dbb968369..000000000 --- a/model/setInfo.md +++ /dev/null @@ -1,26 +0,0 @@ - - -## model.setInfo(value) - - - -Set the current Model information - -@status current Introduced in 2.0.6, changed in TODO - - -#### Parameters - -* `value` model information data, see model.getInfo() - - - -#### Return value - -none - -##### Notice -If a parameter is missing from the value, then -that parameter remains unchanged. - - diff --git a/model/setLogicalSwitch.md b/model/setLogicalSwitch.md deleted file mode 100644 index d46630b0f..000000000 --- a/model/setLogicalSwitch.md +++ /dev/null @@ -1,32 +0,0 @@ - - -## model.setLogicalSwitch(switch, value) - - - -Set Logical Switch parameters - -@status current Introduced in 2.0.0 - - -#### Parameters - -* `switch` (unsigned number) logical switch number (use 0 for LS1) - -* `value` (table) see model.getLogicalSwitch() for table format - - - -#### Return value - -none - -##### Notice -If a parameter is missing from the value, then -that parameter remains unchanged. - - -To set the `and` member (which is Lua keyword) -use the following syntax: `model.setLogicalSwitch(30, {func=4,v1=1,v2=-99, ["and"]=24})` - - diff --git a/model/setModule.md b/model/setModule.md deleted file mode 100644 index 221c89051..000000000 --- a/model/setModule.md +++ /dev/null @@ -1,28 +0,0 @@ - - -## model.setModule(index, value) - - - -Set RF module parameters - -@status current Introduced in 2.2.0, modified in 2.3.12 (proto/subproto) - - -#### Parameters - -* `index` (number) module index (0 for internal, 1 for external) - -* `value` module parameters, see model.getModule() - - - -#### Return value - -none - -##### Notice -If a parameter is missing from the value, then -that parameter remains unchanged. - - diff --git a/model/setOutput.md b/model/setOutput.md deleted file mode 100644 index 85e6dd00f..000000000 --- a/model/setOutput.md +++ /dev/null @@ -1,28 +0,0 @@ - - -## model.setOutput(index, value) - - - -Set servo parameters - -@status current Introduced in 2.0.0 - - -#### Parameters - -* `index` (unsigned number) channel number (use 0 for CH1) - -* `value` (table) servo parameters, see model.getOutput() for table format - - - -#### Return value - -none - -##### Notice -If a parameter is missing from the value, then -that parameter remains unchanged. - - diff --git a/model/setTimer.md b/model/setTimer.md deleted file mode 100644 index 1d4cf8831..000000000 --- a/model/setTimer.md +++ /dev/null @@ -1,28 +0,0 @@ - - -## model.setTimer(timer, value) - - - -Set model timer parameters - -@status current Introduced in 2.0.0, name added in 2.3.6 - - -#### Parameters - -* `timer` (number) timer index (0 for Timer 1) - -* `value` timer parameters, see model.getTimer() - - - -#### Return value - -none - -##### Notice -If a parameter is missing from the value, then -that parameter remains unchanged. - - diff --git a/one-time_scripts.md b/one-time_scripts.md deleted file mode 100644 index 4c8b82f54..000000000 --- a/one-time_scripts.md +++ /dev/null @@ -1,23 +0,0 @@ -# One-Time Scripts - -#####Overview - -One-Time scripts start when called upon by a specific radio function or when the user selects them from a contextual menu. They do their task and are then terminated and unloaded. Please note that all persistent scripts are halted during the execution of one time scripts. They are automatically restarted once the one time script is finished. This is done to provide enough system resources to execute the one time script. - -#####***WARNING! - *** - - Running a One-Time script will suspend execution of all other currently loaded Lua scripts (Mix, Telemetry, and Functions) - -##### File Location - -Place them anywhere on SD card, the folder /SCRIPTS/ is recommended. The only exception is official model wizard script, that should be put into /SCRIPTS/WIZARD/ folder that way it will start automatically -when new model is created. - -##### Lifetime of One-Time scripts - -Script is executed when user selects Execute on a script file from SD card browser screen. - -Script executes until: - - it returns value different from 0 - - is forcefully closed by user by long press of EXIT key - - is forcefully closed by system if if it misbehaves (too long runtime, error in code, low -memory) \ No newline at end of file diff --git a/optimization_tricks.md b/optimization_tricks.md deleted file mode 100644 index e4890a476..000000000 --- a/optimization_tricks.md +++ /dev/null @@ -1,31 +0,0 @@ -# Speed and Memory Optimization Tricks - - -## Faster getValue() - -Normally one uses [getValue()](general/getValue.md) function with the source/filed name like so: - -```lua -local foo = getValue("bar") -``` - -This works and is recommended method for portability. But if a particular script needs to get the value of certain field a lot, then it is faster to use this syntax: - -```lua - -local my_id = getFiledInfo("bar").id -- here we get the numerical id of the filed "bar" - -local function run_a_lot() - local my_value = getValue(my_id) -- exactly the same effect as local my_value = getValue("bar"), but faster -end -``` - -Why is this method faster? With the function [getFieldInfo(name)](general/getFieldInfo.md) we get the `numerical id` of the wanted filed. The function has to find the requested value by its name in the table of all available sources. That search takes some time. - -When we use this syntax the search is only done once. In comparison in the first -example the search must be performed every time `getValue("bar")` is called. - -So when the `getValue(my_id)` is called the search can be skipped and the requested value if fetched directly. - -Of course there is a trade-of, the second example uses little more memory (for variable `my_id`). - diff --git a/output_table_syntax.md b/output_table_syntax.md deleted file mode 100644 index 523ae2071..000000000 --- a/output_table_syntax.md +++ /dev/null @@ -1,37 +0,0 @@ -# Output Table Syntax - -#####Overview - -Outputs are only used in mix scripts. The output table defines only name(s), the actual values are determined by the script's [run function](run_function_syntax.md). - -```lua -{ "", "" } -``` - - -Example: -```lua -local output { "Val1", "Val2" } - -local function run() - return 0, -1024 -- these values will be available in OpenTX as Val1 and Val2 -end - -return {output=output, run=run} -``` - -#####Notes: - -* Output name is limited to four characters. - -* A maximum of 6 outputs are supported - -* Number Format -Outputs are 16 bit signed integers when they leave Lua script and are then divided by 10.24 to produce output value in percent: - -|Script Return Value|Mix Value in OpenTX| -|-----|----| -|0| 0%| -|996| 97.2%| -|1024| 100%| -|-1024|-100%| diff --git a/part_i_-_script_type_overview.md b/part_i_-_script_type_overview.md deleted file mode 100644 index d5b5df8aa..000000000 --- a/part_i_-_script_type_overview.md +++ /dev/null @@ -1,3 +0,0 @@ -# Part I - Script Type Overview - -This section introduces the types of Lua scripts supported by OpenTX and how they may be used. \ No newline at end of file diff --git a/part_i_-_script_type_overview/README.md b/part_i_-_script_type_overview/README.md deleted file mode 100644 index a3a6290d6..000000000 --- a/part_i_-_script_type_overview/README.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -description: >- - This section introduces the types of Lua scripts supported by EdgeTX and how - they may be used. ---- - -# Part I - Script Type Overview - diff --git a/part_i_-_script_type_overview/function_scripts.md b/part_i_-_script_type_overview/function_scripts.md deleted file mode 100644 index 1882efa77..000000000 --- a/part_i_-_script_type_overview/function_scripts.md +++ /dev/null @@ -1,52 +0,0 @@ -# Function Scripts - -## Overview - -Function scripts are invoked via the **'Lua Script'** option of Special Functions configuration page. - -Typical uses of Function scripts are: - -* specialized handling in response to switch position changes -* customized announcements - -Please be aware that: - -* all function scripts are stopped if a One-Time Lua script is running -* Function scripts **DO NOT HAVE ACCESS TO LCD DISPLAY** - -## Lifetime - -* `init` function is called once when the model is selected -* depending on the switch associated with the Special Function, either the `run` function \(switch = on\) or the `background` function \(switch = off\) is called periodically -* the script is stopped and disabled if it misbehaves \(e.g. run-time error or low memory\) - -## File Location - -Scripts are located on the SD card in the folder /SCRIPTS/FUNCTIONS/<_name_>.lua. File name length \(without extension\) **must be 6 characters or less** \(this limit was 8 characters in OpenTX 2.1\). - -## Interface - -Every script must include a `return` statement at the end, defining its interface to EdgeTX. This statement returns a table with the following fields: - -* `init` function \(optional\) -* `run` function -* `background` function \(optional\) - -### Example - -```lua -local function init() - -- Called once when the script is loaded -end - -local function run() - -- Called periodically while the Special Function switch is on -end - -local function background() - -- Called periodically while the Special Function switch is off -end - -return { run=run, background=background, init=init } -``` - diff --git a/part_i_-_script_type_overview/telemetry.md b/part_i_-_script_type_overview/telemetry.md deleted file mode 100644 index f4f88da4e..000000000 --- a/part_i_-_script_type_overview/telemetry.md +++ /dev/null @@ -1,51 +0,0 @@ -# Telemetry Scripts - -## Overview - -Telemetry scripts are used for building customized screens. Each model can have up to three active scripts as configured on the model's telemetry configuration page. The same script can be assigned to multiple models. - -**Please note:** Telemetry scripts are only available on radios with telemetry screens, such as e.g. FrSky Taranis models \(including Xlite\), Radiomaster TX12 and and Jumper T12. - -## Lifetime - -* Telemetry scripts are loaded when the model is selected. -* `init` function is called one time when the script is loaded -* `background` function is periodically; both when the telemetry screen is visible and when it is not. -* `run` function is called periodically only when the telemetry screen is visible -* script is stopped and disabled if it misbehaves \(e.g. run-time error or low memory\) -* all telemetry scripts are stopped if a one-time script is running \(see One-time scripts\) - -## File Location - -Scripts are located on the SD card in the folder /SCRIPTS/TELEMETRY/<_name_>.lua. File name length \(without extension\) **must be 6 characters or less** \(this limit was 8 characters in OpenTX 2.1\). - -## Interface - -Every script must include a `return` statement at the end, defining its interface to EdgeTX. This statement returns a table with the following fields: - -* `init` function \(optional\) -* `background` function \(optional\) -* `run` function - -### Example - -```lua -local function init() - -- init is called once when model is loaded -end - -local function background() - -- background is called periodically -end - -local function run(event) - -- run is called periodically only when screen is visible -end - -return { run = run, background = background, init = init } -``` - -### Notes: - -* The `event` parameter indicates which transmitter key has been pressed \(see [Key Events](../part_iii_-_opentx_lua_api_reference/constants/key_events.md)\). - diff --git a/part_i_-_script_type_overview/widget_scripts.md b/part_i_-_script_type_overview/widget_scripts.md deleted file mode 100644 index 05e4c95bc..000000000 --- a/part_i_-_script_type_overview/widget_scripts.md +++ /dev/null @@ -1,109 +0,0 @@ -# Widget Scripts - -## Overview - -Most of the time, widget scripts show some info in a _zone_ either in the _top bar_ or in one of the user defined _main views_, and they cannot receive direct input from the user via key events like e.g. Telemetry scripts. - -But widgets on the main views can also be shown in _full screen mode_, where they take over the entire screen area. And here they receive user input via key events, and for radios with touch screen, also touch events. Full screen mode can be entered by selecting the widget, pressing ENTER and selecting **Full screen** on the widget menu, or by double tapping the widget on radios with a touch screen. Full screen mode can be exited by long pressing the RETURN button, or by calling the Lua function `lcd.exitFullScreen()`. - -Each model can have up to five main views, with up to 8 widgets per screen, depending on their size and layout. Each instance of a widget has his own _options_ table. - -**Please note:** Widget scripts are only available on radios with color screens, e.g. FrSky Horus models, Radiomaster TX16 and Jumper T16. - -## Lifetime - -All widget scripts on the SD card are loaded into memory when the model is selected; even widgets that are not used. This has the side effect that any global functions defined in a widget script will always be available to other widget scripts. It also means that any script on the SD card will consume part of the radio's memory - even if it is not being used. Therefore, it is important to either keep widget scripts small, or to use Lua's loadScript() function to load code dynamically. - -They can be added to the top bar or a main view through the telemetry setup menu. When a widget has been added to a screen, then the widget functions are called as follows: - -* `create` is called once when the widget instance is registered (started). -* `update` is called when widget settings are changed by the user. -* `background` is called periodically when the widget instance _is_ _not_ visible. **Note:** this is different from the way that telemetry scripts are handled. -* `refresh` is called periodically when the widget instance _is_ visible. **Note:** if you want `background` to run when the widget is visible, then call it from `refresh`. -* A widget script is stopped and disabled if it misbehaves (e.g. too long runtime, run-time error, or low memory) -* All widgets are stopped while a One-Time script is running (see [One-Time scripts](one-time\_scripts.md)). - -## File Location - -Widgets are located on the SD card, each in their specific folder /WIDGETS/<_name_>/main.lua (<_name_> must be in 8 characters or less). - -## Interface - -Every script must include a `return` statement at the end, defining its interface to EdgeTX. This statement returns a table with the following fields: - -* `name` string -* `options` table -* `create` function -* `update` function -* `background` function (optional) -* `refresh` function - -### Example - -```lua -local name = "WidgetName" - --- Create a table with default options --- Options can be changed by the user from the Widget Settings menu --- Notice that each line is a table inside { } -local options = { - { "Source", SOURCE, 1 }, - -- BOOL is actually not a boolean, but toggles between 0 and 1 - { "Boolean", BOOL, 1 }, - { "Value", VALUE, 1, 0, 10}, - { "Color", COLOR, ORANGE }, - { "Text", STRING, "Max8chrs" } -} - -local function create(zone, options) - -- Runs one time when the widget instance is registered - -- Store zone and options in the widget table for later use - local widget = { - zone = zone, - options = options - } - -- Add local variables to the widget table, - -- unless you want to share with other instances! - widget.someVariable = 3 - -- Return widget table to EdgeTX - return widget -end - -local function update(widget, options) - -- Runs if options are changed from the Widget Settings menu - widget.options = options -end - -local function background(widget) - -- Runs periodically only when widget instance is not visible -end - -local function refresh(widget, event, touchState) - -- Runs periodically only when widget instance is visible - -- If full screen, then event is 0 or event value, otherwise nil -end - -return { - name = name, - options = options, - create = create, - update = update, - refresh = refresh, - background = background -} -``` - -### Notes - -* The `name` must be max. 10 characters long. -* `options` is passed to `create` and then stored in Lua. Changing it has no effect on EdgeTX. -* If `options` is changed by the user in the Widget Settings menu, then `update` will be called with a new `options` table, unaffected by any changes made by Lua code to the old `options` table. -* Maximum five `options` are allowed, with names of max. 10 characters, and no spaces. cf. [widget options constants](../part\_iii\_-\_opentx\_lua\_api\_reference/constants/widget-options.md) for valid option types. -* If local variables are declared outside functions in the widget script, then they are shared between all instances of the widget. -* Therefore, local variables that are private for each instance should be added to the `widget` table in the `create` function before returning the `widget` table to EdgeTX. -* When the widget is in full screen mode, then `event` is either 0, a [key event value](../part\_iii\_-\_opentx\_lua\_api\_reference/constants/key\_events.md), or a [touch event value](../part\_iii\_-\_opentx\_lua\_api\_reference/constants/touch-event-constants.md). -* If `event` is a [touch event value](../part\_iii\_-\_opentx\_lua\_api\_reference/constants/touch-event-constants.md), then `touchState` is a table. Otherwise, it is `nil`. -* When the widget is not in full screen mode, then both `event` and `touchState` are `nil`. -* The size of the widget's screen area is as follows: - * Full screen mode: `LCD_W` by `LCD_H` - * Not full screen mode: `zone.w` by `zone.h` (updated if screen options are changed) diff --git a/part_ii_-_opentx_lua_api_programming_guide.md b/part_ii_-_opentx_lua_api_programming_guide.md deleted file mode 100644 index efb1fe9b0..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide.md +++ /dev/null @@ -1,2 +0,0 @@ -# Part II - OpenTX Lua API Programming Guide -This section provides more specifics on the OpenTX Lua implementation. Here you will find syntax rules for interface tables and functions. \ No newline at end of file diff --git a/part_ii_-_opentx_lua_api_programming_guide/README.md b/part_ii_-_opentx_lua_api_programming_guide/README.md deleted file mode 100644 index fe02f20eb..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Part II - EdgeTX Lua API Programming Guide - -This section provides more specifics on the EdgeTX Lua implementation. Here you will find syntax rules for interface tables and functions. - diff --git a/part_ii_-_opentx_lua_api_programming_guide/data-exchange-with-the-edgetx-model-setup.md b/part_ii_-_opentx_lua_api_programming_guide/data-exchange-with-the-edgetx-model-setup.md deleted file mode 100644 index 115221d60..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/data-exchange-with-the-edgetx-model-setup.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -description: >- - An EdgeTX model has several data components that can be exchanged with Lua - scripts. This section gives an overview. ---- - -# Data Exchange with the EdgeTX Model Setup - -In general terms, there are two different types of data that can be exchanged with EdgeTX: - -* Values, which generally fall on a scale between -1024 and 1024, also sometimes reported as -100% to 100%, e.g. for mixer values and channel outputs. -* Switches, which are either `true` or `false.` - -A specific data source type, e.g. Global Variables, can be indexed directly with an index that starts with 0 for the first one. This can be a little confusing, as e.g. GV1 for FM0 is read with [`model.getGlobalVariable(0, 0)`](../part\_iii\_-\_opentx\_lua\_api\_reference/model-functions-less-than-greater-than-luadoc-begin-model/getglobalvariable.md), because GV1 is the first global variable, and FM0 is the first flight mode. But as long as you remember that all direct indices start with 0 for the first one, you should be fine! - -Global Variables is a _value_ data source that can return a value between -1024 and 1024. Examples of value sources are: - -* Global Variables -* Sticks, sliders and knobs -* Trim values -* Input lines -* Channel outputs -* Trainer channel inputs -* Telemetry sensors - -There is a way to access a value of _any_ such type with a _meta-index_. You use the function [`getFieldInfo(name)`](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getfieldinfo.md) where `name` can be any of the valid source names listed [here](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getfieldinfo.md). It returns a table with a description of the value source, including the field `id,` which is the meta-index. - -You can use `id` with the function [`getValue(id)`](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getvalue.md) to read the current value. You can also use `name` directly, but this is less efficient, as EdgeTX does a linear search for the name every time it is called. Therefore, the procedure of first extracting the meta-index from `getFieldInfo(name).id`, and then using that, is recommended. - -For switches, [`getLogicalSwitchValue(index)`](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getlogicalswitchvalue-id.md) uses a direct index to read this specific type of switch sources, again using the `index` 0 for LS1 etc. But there are also several types of switch sources, such as: - -* Logical switches -* Switch positions, testing if a physical switch is in a particular position, e.g. `SA↑`. -* Trim buttons -* Transmitter and telemetry activity - -You can find the meta-index of a particular switch source with [`getSwitchIndex(name)`](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchindex-positionname.md), where `name` is exactly the name that you see in the radio menus where you can select a switch source. - -You can read the current value of a switch source with [`getSwitchValue(index)`](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchvalue-switchindex.md) as a `true`/`false` value. - -It can be very confusing that some source can be read both as a value and as a switch. As an example, elevator trim can be read as the current value of the _trim_: - -```lua -local id = getFieldInfo("trim-ele") -local eleTrim = getValue(id) -``` - -Or it can be read as the current value of the _trim button position_: - -```lua -local idUp = getSwitchIndex(CHAR_TRIM .. "Eu") -local idDown = getSwitchIndex(CHAR_TRIM .. "Ed") -local eleUp = getSwitchValue(idUp) -local eleDown = getSwitchValue(idDown) -``` - -These are really two different things, as the elevator _trim_ is an internal value stored by the radio, which is changed with the trim button, and the button is a physical button. - -But it can also be a more direct comparison, e.g. the 3-position switch B, which can be read as a _value_ source with: - -```lua -local idB = getFieldInfo("sb") -local swBvalue = getValue(idB) -- a value of -1024, 0 or 1024 -``` - -Or the current position of switch B can be read with: - -```lua -local idBup = getSwitchIndex("SB" .. CHAR_UP) -local idBdown = getSwitchIndex("SB" .. CHAR_DOWN) -local swBup = getSwitchValue(idBup) -local swBdown = getSwitchValue(idBdown) -``` - -Hopefully, these examples illustrated the differences between _values_ and _switches_, and showed how these can be retrieved in a Lua script. - -You can also send data the other way: from Lua to the EdgeTX model setup. - -To send a _value_, use a global variable: `model.setGlobalVariable(index, fm, value)`. If you use the default GV setting, where all other flight modes use the value of FM0, then you can use 0 for `fm`. - -To send a _switch_, setup a `STICKY` type logical switch, and then use `setStickySwitch(index, true/false)`. - -The following table gives an overview of the Lua API functions that can be used to exchange data with the EdgeTX model setup. - -| Function | Description | -| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `getFieldInfo(name)` | Gets the meta-index of a _value_ source with `name`. | -| `getValue(index)` | Gets the current value of a source, where `index` is from the above. | -| `getFlightMode()` | Returns the current flight mode number and name. **Do not** confuse with `model.getFlightMode`, which is a completely different function! | -| `model.getGlobalVariable( index, fm)` | Read the value of a global variable between -1024 and 1024. You can use the above to get the current flioght mode for `fm`, or you can setup the GV to always use the value from FM0. | -| `model.setGlobalVariable( index, fm, value)` | Sets the value of a global variable. | -| `setTelemetryValue(id, subID, instance, value, ...)` | This function can send data from Lua to a telemetry sensor. If it is running, then the sensor will show up with Discover Sensors. This can be used to log values generated by Lua. | -| `getLogicalSwitchValue( index)` | Get the value of a logical switch. | -| `setStickySwitch(id, value)` | Set the value of a `STICKY` type logical switch. | -| `getSwitchIndex(name)` | Get the meta-index of a switch source with `name`. | -| `getSwitchName(index)` | Get the name of a switch source. | -| `getSwitchValue(index)` | Get the value of a switch source. | -| `getPhysicalSwitches()` | Get a list of physical switches on the radio. Can be used to make a selection list. | -| `getShmVar(index)` | Get the value of a shared memory variable. These are little "mail boxes" provided as a way to send data between Lua widgets and other Lua scripts like Mixer and Function scripts. | -| `setShmVar(index, value)` | Set the value of a shared memory variable. | -| `model.setTimer(timer, value)` | Set the timer to `value`. | -| `model.getTimer(timer)` | Read the timer. | - diff --git a/part_ii_-_opentx_lua_api_programming_guide/drawing-flags-and-colors.md b/part_ii_-_opentx_lua_api_programming_guide/drawing-flags-and-colors.md deleted file mode 100644 index c8efe20db..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/drawing-flags-and-colors.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -description: This section will give some technical details for radios with a color screen. ---- - -# Drawing Flags and Colors - -An argument with drawing flags can be given to the various functions that draw on the LCD screen. The lower half of the flags \(bits 1-16\) are the flag attributes shown below, and the upper half of the flags \(bits 17-32\) are a color value. - -Not all of the flags below should be directly manipulated from Lua, but those that are meant to be set directly by Lua, are accessible by the [Lua flag constants](../part_iii_-_opentx_lua_api_reference/constants/flags-and-pattern-constants.md#flags). - -![](../.gitbook/assets/flags%20%281%29.png) - -Since the flags are bits, you can add them up to combine, as long as you only add each flag _one_ time. If you add the same flag twice, then it will add up to the next bit over, e.g. `INVERS + INVERS = VCENTER`. If you want to add a flag to a value where it may already be set, then use `flags = bit32.bor(flags, INVERS)`. - -RGB\_FLAG decides how the color value is encoded into the upper half \(bits 17-32\). - -If RGB\_FLAG = 0, then an index into a color table is stored. This color table holds a default color \(index 0\), the theme colors, and CUSTOM\_COLOR. The entries in the color table can be changed with the function [`lcd.setColor`](../part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/setcolor.md). The advantage of this system is that the color changes everywhere that this indexed color is used, and this is how different color themes are created. **Notice that changing the theme colors affects the entire user interface of your radio!!** - -If RGB\_FLAG = 1, then a 16-bit RGB565 color is stored. This is used directly by the system to draw a color on the screen. - -You should not change RGB\_FLAG explicitly; this is handled automatically by the various functions and Lua constants. But you should be aware of the following. - -* [`lcd.setColor`](../part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/setcolor.md) must have an [indexed color](../part_iii_-_opentx_lua_api_reference/constants/color-constants.md#indexed-colors) as its first argument, because this will be the index of the color in the table being changed. Giving another color, e.g. ORANGE, as the first argument will result in nothing. -* If no color is given to the flags with a drawing function, RGB\_FLAGS = 0 and the color index = 0. Therefore, the default color is stored in the color table under this index, and you can change the default color with `lcd.setColor(0, color)`. -* [`lcd.getColor` ](../part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getcolor.md)always returns a RGB color. This can be used to "save" an indexed color before you change it. -* [`lcd.RGB`](../part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/rgb.md) obviously returns a RGB color. - -### Colors in EdgeTX versus OpenTX - -OpenTX only supports indexed colors in drawing functions, so you must first call `lcd.setColor` to change e.g. CUSTOM\_COLOR, and then call the LCD drawing function with that indexed color. In EdgeTX, you can use either type of color for drawing functions, so you are no longer forced to constantly call `lcd.setColor`. You can also store any color in local variables, and then use these when drawing, thus effectively creating your own color theme. - -In OpenTX, `lcd.RGB` returns a 16 bit RGB565 value, but in EdgeTX it returns a 32 bit flags value with the 16 bit RGB565 value in the upper half \(bits 17-32\). Therefore, colors in EdgeTX are not binary compatible with colors in OpenTX. But if you use the functions `lcd.RGB`, `lcd.setColor`, and `lcd.getColor`, then your code should work the same way in EdgeTX as in OpenTX. - -Unfortunately, OpenTX has disabled the function `lcd.RGB` when the screen is not available for drawing, so it can only be called successfully from the `refresh` function in widgets and from the `run` function in One-Time scripts. Therefore, some existing widget scripts set up colors with hard coded constants instead of calling `lcd.RGB` during initialization, and this is not going to work with EdgeTX, because of the different binary format. - -A pull request has been submitted to OpenTX, allowing `lcd.RGB` to work also during widget script initialization, and hopefully, it will be merged into OpenTX 2.3.15. If that happens, then the obvious way to solve the problem is to use `lcd.RGB` values instead of hard coded color constants. But in the meantime, the following RGB function can be used for setting up colors in a way that works for both EdgeTX and OpenTX. - -```lua -local function RGB(r, g, b) - local rgb = lcd.RGB(r, g, b) - - if not rgb then - rgb = bit32.lshift(bit32.rshift(bit32.band(r, 0xFF), 3), 11) - rgb = rgb + bit32.lshift(bit32.rshift(bit32.band(g, 0xFF), 2), 5) - rgb = rgb + bit32.rshift(bit32.band(b, 0xFF), 3) - end - - return rgb -end -``` - -This functions calls `lcd.RGB`, and if it gets a nil value \(because we are running a widget script under OpenTX, and it is not called from the `refresh` function\) then it creates the 16-bit RGB565 value that OpenTX wants. - diff --git a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/README.md b/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/README.md deleted file mode 100644 index 7e5c59b29..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Included Lua Libraries - -| Lua Standard Libraries | Included | -| ---------------------- | ------------------------------------------------------- | -| package | - | -| coroutine | - | -| table |

since OpenTX 2.3.8

(color LCD radios only)

| -| [io](io-library/) | since OpenTX 2.1.0 (with limitations) | -| os | - | -| string | since OpenTX 2.1.7 | -| bit32 | since OpenTX 2.1.0 | -| math | since OpenTX 2.0.0 | -| debug | - | diff --git a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/bit32.library.md b/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/bit32.library.md deleted file mode 100644 index 13d4cd5d4..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/bit32.library.md +++ /dev/null @@ -1,4 +0,0 @@ -# bit32.Library - -TODO - diff --git a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/README.md b/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/README.md deleted file mode 100644 index 55dff2d4b..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# io Library - -The **io** library has been simplified and only a subset of functions and their functionality is available. What follows is a complete reference of io functions that are available to EdgeTX scripts - -## Available functions: - -* io.open() -* io.close() -* io.read() -* io.write() -* io.seek() - -## Examples - -### Read the whole file - -```lua --- this is a stand-alone script - -local function run(event) - print("lua io.read test") -- print() statements are visible in Debug output window - local f = io.open("foo.bar", "r") - while true do - local data = io.read(f, 10) -- read up to 10 characters (newline char also counts!) - if #data == 0 then break end -- we get zero length string back when we reach end of the file - print("data: "..data) - end - io.close(f) - return 1 -end - -return { run=run } -``` - -### Append data to file - -```lua --- this is a stand-alone script - -local function run(event) - print("lua io.write test") - local f = io.open("foo.bar", "a") -- open file in append mode - io.write(f, "first line\r\nsecond line\r\n") - io.write(f, 4, "\r\n", 35.6778, "\r\n") -- one can write multiple items at the same time - local foo = -4.45 - io.write(f, foo, "\r\n") - io.close(f) - return 1 -- this will end the script execution -end - -return { run=run } -``` diff --git a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.close.md b/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.close.md deleted file mode 100644 index 3198b3218..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.close.md +++ /dev/null @@ -1,11 +0,0 @@ -# io.close() - -The io.close() function is used to close open file. - -## Parameters - -* `file object` a file object that was returned by the io.open() function. - -## Return value - -* none diff --git a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.open.md b/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.open.md deleted file mode 100644 index 63da604cc..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.open.md +++ /dev/null @@ -1,16 +0,0 @@ -# io.open() - -The io.open() function is used to open the file on SD card for subsequent reading or writing. After the script is done with the file manipulation io.close() function should be used. - -## Parameters - -* `filename` full path to the file starting from the SD card root directory. This function can't create a new file in non-existing directory. -* `mode` supported mode strings are: - * `"r"` read access. File must exist beforehand. The read pointer is located at the beginning of file. This is the default mode if is omitted. - * `"w"` write access. File is opened or created (if it didn't exist) and truncated (all existing file contents are lost). - * "a" write access. File is opened or created (if it didn't exist) and write pointer is located at the end of the file. The existing file contents are preserved. - -## Return value - -* `` if file was successfully opened. -* `nil` if file could not be opened. diff --git a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.read.md b/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.read.md deleted file mode 100644 index 0ed13f47b..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.read.md +++ /dev/null @@ -1,15 +0,0 @@ -# io.read() - -The io.read() function is used to read data from the file on SD card. - -_Notice:_ other read _commands_ (like "_all", etc..) are \*not supported_. - -## Parameters - -* `file object` a file object that was returned by the io.open() function. The file must be opened in read mode. -* `length` number of characters/bytes to read. The number of actual read/returned characters can be less if the file end is reached. - -## Return value - -* `` a string with a length equal or less than -* `""` a zero length string if the end of file was reached diff --git a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.seek.md b/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.seek.md deleted file mode 100644 index 923b68581..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.seek.md +++ /dev/null @@ -1,15 +0,0 @@ -# io.seek() - -The io.seek() function is used to move the current read/write position. - -_Notice:_ other read standard seek bases (like "cur", "end") are **not supported**. - -## Parameters - -* `file object` a file object that was returned by the io.open() function. -* `offset` position the read/write file pointer at the specified offset from the beginning of the file. If specified offset is bigger than the file size, then the pointer is moved to the end of the file. - -## Return value - -* `0` success -* `` any other value means failure. diff --git a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.write.md b/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.write.md deleted file mode 100644 index 3d1e83012..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/io-library/io.write.md +++ /dev/null @@ -1,13 +0,0 @@ -# io.write() - -The io.write() function is used to write data to the file on SD card. - -## Parameters - -* `file object` a file object that was returned by the io.open() function. The file must be opened in write or append mode. -* `data` any Lua type that can be converted into string. If more than one data parameter is used their contents are written to the file by one in the same order as they are specified. - -## Return value - -* `` if data was successfully opened. -* `nil, , ` if the data can't be written. diff --git a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/math.library.md b/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/math.library.md deleted file mode 100644 index 006048af4..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/math.library.md +++ /dev/null @@ -1,4 +0,0 @@ -# math.Library - -TODO - diff --git a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/string.library.md b/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/string.library.md deleted file mode 100644 index 13c9e6b9e..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/included_lua_libraries/string.library.md +++ /dev/null @@ -1,4 +0,0 @@ -# string.Library - -TODO - diff --git a/part_ii_-_opentx_lua_api_programming_guide/init_function_syntax.md b/part_ii_-_opentx_lua_api_programming_guide/init_function_syntax.md deleted file mode 100644 index 31776c0a8..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/init_function_syntax.md +++ /dev/null @@ -1,18 +0,0 @@ -# Init Function Syntax - -If defined, _init_ function is called right after the script is loaded from SD card and begins execution. Init is called only once before the run function is called for the first time. - -```lua -local function () - -- code here runs only once when the model is loaded -end -``` - -* **Input Parameters:** - - none - -* **Return values:** - - none - diff --git a/part_ii_-_opentx_lua_api_programming_guide/input_table_syntax.md b/part_ii_-_opentx_lua_api_programming_guide/input_table_syntax.md deleted file mode 100644 index 794aefa74..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/input_table_syntax.md +++ /dev/null @@ -1,51 +0,0 @@ -# Input Table Syntax - -## Overview - -The input table defines what values are available as input\(s\) to [mix scripts](../part_i_-_script_type_overview/mix.md). There are two forms of input table entries. - -* **SOURCE syntax** - - ```lua - { "", SOURCE } - ``` - - SOURCE inputs provide the current value of a selected OpenTX variable. The source must set by the user when the mix script is configured. Source can be any value OpenTX knows about \(inputs, channels, telemetry values, switches, custom functions,...\). - _Note:_ typical range is -1024 thru +1024. Simply divide the input value by 10.24 to interpret as a percentage from -100% to +100%. - -* **VALUE syntax** - - ```lua - { "", VALUE, , , } - ``` - - VALUE inputs provide a constant value that is set by the user when the mix script is configured. - - * _name_ - maximum length of 8 characters - * _min_ - minimum value of -128 - * _max_ - maximum value of 127 - * _default_ - must be within the valid range specified - -* **Maximum of 6 inputs per script \(warning : was 8 in 2.1\)** - -## Example using a SOURCE and a VALUE - -```lua -local input = - { - { "Strength", SOURCE}, -- user selects source (typically slider or knob) - { "Interval", VALUE, 0, 100, 0 } -- interval value, default = 0. - } - -local function run(strength, interval) - -- variable strength will contain the current slider value - -- variable interval is set by the user and constant through script lifetime - - -- this script has no return value but may use playFile() to alert user - - return -end - -return {input=input, run=run} -``` - diff --git a/part_ii_-_opentx_lua_api_programming_guide/loading-code-modules-dynamically.md b/part_ii_-_opentx_lua_api_programming_guide/loading-code-modules-dynamically.md deleted file mode 100644 index a6807657a..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/loading-code-modules-dynamically.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -description: >- - Lua makes it easy to load and unload code modules on the fly, to save memory - or to provide program extensions. ---- - -# Loading Code Modules Dynamically - -The [`loadScript()`](../part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/loadscript.md) function will load a script from a the file and return a function that is the body of the script, as described in the previous section. So you could have the following Lua script file saved on the SD card: - -```lua --- /SCRIPTS/TestScript.lua -local c = ... - -local function f(x) - return x + c -end - -return f -``` - -You can load and use the above file with the following code: - -```lua -local chunk = loadScript("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/SCRIPTS/TestScript.lua") - -local f1 = chunk(1) -local y = f1(5) --- y = 5 + 1 - -local f2 = chunk(3) -local z = f2(5) --- z = 5 + 3 -``` - -So here we put together what we learned in the previous section. The body of the script is an anonymous function returned by `loadScript` and stored in the variable `chunk`. It returns the function `f` when it is called. The local variable `c` in the script is assigned to the first _vararg_ passed to the call. Since a new closure is created every time we call `chunk`, `f1` and `f2` have different closures with different values of `c`. - diff --git a/part_ii_-_opentx_lua_api_programming_guide/lua-basics.md b/part_ii_-_opentx_lua_api_programming_guide/lua-basics.md deleted file mode 100644 index 39117d322..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/lua-basics.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -description: >- - Lua is a small but powerful language. This section will explain a few of the - most important concepts. ---- - -# Lua Basics - -## Introduction - -Lua was chosen for OpenTX, and hence also EdgeTX, because it is a small language designed to be highly extensible by libraries written in C and C++, so it can be integrated into other systems like EdgeTX. It is also relatively efficient, both in terms of memory and CPU usage, and hence well suited for the radios. - -In addition to the provided libraries, Lua has a very elegant mechanism for loading new Lua code modules during run-time. A lot of the elegance comes from the way that the loading mechanism meshes with another concept supported by Lua: first class functions with closures. - -## First Class Functions - -Computer science pioneer Christopher Strachey introduced the concept of functions as _first-class objects_ in his paper [Fundamental Concepts in Programming Languages](https://web.archive.org/web/20100216060948/http://www.cs.cmu.edu/\~crary/819-f09/Strachey67.pdf) from 1967. What it means is that functions can be treated as other variables: as arguments passed in function calls, as results returned from function calls, and a function identifier can be re-assigned to another chunk of function code, just like a variable ca be assigned to a new value. - -In Lua, a function declaration is really "syntactic sugar" for assigning a variable to the chunk of code that is called when the function is invoked, i.e. - -`local function f(x) return x + 1 end` - -is the same as - -`local f = function(x) return x + 1 end` - -You can even add functions to Lua tables, i.e. - -`t = { f = f }` - -will add the above function to the table `t`, as a field that is also called `f`. Does that look familiar to the return statement required at the end of a Lua script? - -Yes indeed, because a script is really an anonymous function that returns a list of functions to the system. The function declarations assign variables to chunks of function code, these variables are added to the list returned at the end of the script, and the system then calls the functions periodically to run the script. So the script itself is run one time initially, and subsequently the functions returned by the last statement are called periodically. - -## Closures - -Another important concept that goes with first-class functions, is _closures_. This is the environment of the function with the variable names that the function can see. Please consider the following function `counter` that returns another function: - -```lua -local function counter(start, step) - local x = start - - return function() - local y = x - x = x + step - return y - end -end -``` - -The function is returned directly without being assigned to a variable name. The _closure_ of the function returned is the body of the function `counter`, containing both the arguments `start` and `step`, and the local variable `x`. So if `c1 = counter(1, 1)` then `c1()` will return 1, 2, 3, ... when called repeatedly, and if `c2 = counter(2, 3)` then `c2()` will return 2, 5, 8, ... - -Likewise, the local variables that you declare outside the functions of your script can be used by all of the functions in your script, and they persist between function calls, but they are not visible to other scripts. - -The [widget scripts](../part\_i\_-\_script\_type\_overview/widget\_scripts.md) are a little trickier, as you can register multiple instances of the same widget script, and all of these instances run within the same Lua closure. Therefore, local variables declared outside any functions in a widget script are shared among all of the instances of that script. But each call to the `create(...)` function returns a new `widget` list to the system. And since this list is unique to each instance, you can add private instance variables to it. - -## Functions with Variable Number of Arguments - -Please consider this function: - -``` -local function match(x, ...) - for i, y in ipairs({...}) do - if x == y then - return true - end - end - return false -end -``` - -It takes an argument `x` and a [vararg](https://www.lua.org/manual/5.2/manual.html#3.4.10) list `...` A vararg list is just like a list of arguments separated by commas, and you can call the function with any number of arguments greater than 1. Inside the function, you can also treat `...` like a comma separated list of variables, e.g. in the above function, `...` is converted to a table by `{...}` just like you could construct a table by e.g. `{a, b, c}`. The table is iterated with the `ipairs` function to look for an element matching the first argument `x`. So e.g. the following statement - -`if event == EVT_VIRTUAL_ENTER or event == EVT_VIRTUAL_EXIT then` - -can be replaced by - -`if match(event, EVT_VIRTUAL_ENTER, EVT_VIRTUAL_EXIT) then` - -You can also use `...` directly as a comma separated list of values, e.g. `local a, b, c = ...` will assign the three variables to the three first arguments following `x`, or `nil` if none are given. - -## References - -The [Lua 5.2 Reference Manual](https://www.lua.org/manual/5.2/manual.html) helpful, both if you want to learn more about Lua, and if you want to search for answers to specific questions. diff --git a/part_ii_-_opentx_lua_api_programming_guide/output_table_syntax.md b/part_ii_-_opentx_lua_api_programming_guide/output_table_syntax.md deleted file mode 100644 index bd312b3b3..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/output_table_syntax.md +++ /dev/null @@ -1,35 +0,0 @@ -# Output Table Syntax - -## Overview - -Outputs are only used in mix scripts. The output table defines only name\(s\), the actual values are determined by the script's [run function](run_function_syntax.md). - -```lua -{ "", "" } -``` - -Example: - -```lua -local output { "Val1", "Val2" } - -local function run() - return 0, -1024 -- these values will be available in OpenTX as Val1 and Val2 -end - -return {output=output, run=run} -``` - -## Notes: - -* Output name is limited to four characters. -* A maximum of 6 outputs are supported -* Number Format Outputs are 16 bit signed integers when they leave Lua script and are then divided by 10.24 to produce output value in percent: - -| Script Return Value | Mix Value in OpenTX | -| :--- | :--- | -| 0 | 0% | -| 996 | 97.2% | -| 1024 | 100% | -| -1024 | -100% | - diff --git a/part_ii_-_opentx_lua_api_programming_guide/return_statement_syntax.md b/part_ii_-_opentx_lua_api_programming_guide/return_statement_syntax.md deleted file mode 100644 index 5ca4e2b06..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/return_statement_syntax.md +++ /dev/null @@ -1,22 +0,0 @@ -# Return Statement Syntax - -The return statment is the last statement in an OpenTX Lua script. It defines the input/output table values and functions used to run the script. - -Parameters _init_, _input_ and _output_ are optional. If a script doesn't use them, they can be omitted from return statement. - -Example without _init_ and _output_: - -```lua -local inputs = { { "Aileron", SOURCE }, { "Ail. ratio", VALUE, -100, 100, 0 } } - -local function run_func(ail, ratio) - -- do some stuff - if (ail > 50) and ( ratio < 40) then - playFile("foo.wav") - end -end - --- script that only uses input and run -return { run=run_func, input=inputs } -``` - diff --git a/part_ii_-_opentx_lua_api_programming_guide/run_function_syntax.md b/part_ii_-_opentx_lua_api_programming_guide/run_function_syntax.md deleted file mode 100644 index 3e91a1c39..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/run_function_syntax.md +++ /dev/null @@ -1,47 +0,0 @@ -# Run Function Syntax - -The run function is the function that is periodically called for the lifetime of script execution. Syntax of the run function is different between [mix scripts](../part_i_-_script_type_overview/mix.md) and [telemetry scripts](../part_i_-_script_type_overview/telemetry.md). - -## Run Function for Mix Scripts - -```lua -local function ([first input, [second input], …]) - - -- if mix has no return values - return - - -- if mix has two return values - return value1, value2 - -end -``` - -* **Input parameters:** - - zero or more input values, their names are arbitrary, their meaning and order is defined by the input table. \(see [Input Table Syntax]()\) - -* **Return values:** - * none - if output table is empty \(i.e. script has no output\) - - values - - * or - - - * comma separated list of output values, their order and meaning is defined by the output table. \(see [Output Table Syntax]()\) - -## Run Function for Telemetry Scripts - -```lua -local function (key-event) - return 0 -- values other than zero will halt the script -end -``` - -* **Input parameters:** - - The _key-event_ parameter indicates which transmitter button has been pressed \(see [Key Events](../part_iii_-_opentx_lua_api_reference/constants/key_events.md)\) - -* **Return values:** - - A non-zero return value will halt the script - diff --git a/part_ii_-_opentx_lua_api_programming_guide/saving-memory.md b/part_ii_-_opentx_lua_api_programming_guide/saving-memory.md deleted file mode 100644 index 15f48003f..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/saving-memory.md +++ /dev/null @@ -1,174 +0,0 @@ ---- -description: >- - This chapter will show you some ways that large script projects can be fitted - into the limited memory of our radios. ---- - -# Saving Memory - -Regarding memory, the situation is a bit different for the radios with black/white or grey scale screens and telemetry scripts, and the radios with color screens and widget scripts. The telemetry script radios only have 128-192 KB RAM memory - that is _very_ small! The widget script radios have 8 MB RAM memory. But the way that widgets are designed means that _all_ widget scripts present on the SD card will be loaded into memory, whether or not they are actually used. Therefore, different strategies should be applied to save memory for the two different types of radios and scripts. - -## Telemetry Script Radios - -Radios with black/white or grey scale screens and telemetry scripts such as e.g. FrSky Taranis, Xlite, Jumper T12 and Radiomaster TX12 have extremely small RAM memories, and therefore it may be necessary to divide up your script into smaller loadable modules. - -The following simple example demonstrates how different screens can be loaded on demand, and how shared data can be stored in a table. - -```lua --- Main telemetry script - -local shared = { } -shared.screens = { - "/SCRIPTS/Test/menu1.lua", - "/SCRIPTS/Test/menu2.lua", - "/SCRIPTS/Test/menu3.lua" -} - -function shared.changeScreen(delta) - shared.current = shared.current + delta - if shared.current > #shared.screens then - shared.current = 1 - elseif shared.current < 1 then - shared.current = #shared.screens - end - local chunk = loadScript(shared.screens[shared.current]) - chunk(shared) -end - -local function init() - shared.current = 1 - shared.changeScreen(0) -end - -local function run(event) - shared.run(event) -end - -return { run = run, init = init } -``` - -```lua --- /SCRIPTS/Test/menu1.lua - -local shared = ... - -function shared.run(event) - lcd.clear() - lcd.drawText(20, 10, "Screen 1", MIDSIZE) - - if event == EVT_VIRTUAL_NEXT then - shared.changeScreen(1) - elseif event == EVT_VIRTUAL_PREV then - shared.changeScreen(-1) - end -end -``` - -```lua --- /SCRIPTS/Test/menu2.lua - -local shared = ... - -function shared.run(event) - lcd.clear() - lcd.drawText(20, 10, "Screen 2", MIDSIZE) - - if event == EVT_VIRTUAL_NEXT then - shared.changeScreen(1) - elseif event == EVT_VIRTUAL_PREV then - shared.changeScreen(-1) - end -end -``` - -```lua --- /SCRIPTS/Test/menu3.lua - -local shared = ... - -function shared.run(event) - lcd.clear() - lcd.drawText(20, 10, "Screen 3", MIDSIZE) - - if event == EVT_VIRTUAL_NEXT then - shared.changeScreen(1) - elseif event == EVT_VIRTUAL_PREV then - shared.changeScreen(-1) - end -end -``` - -The table `shared` contains data that is shared between the main telemetry script and the loadable screens. Notice that the functions `shared.changeScreen` and `shared.run` are also shared this way. - -Code is loaded by `shared.changeScreen` with the `loadScript` function, which returns the loadable script as a chunk of code. The code is executed with `shared` as the argument, and the loadable script adds a new `run` function to the `shared` table. `shared.run` is called by `run` in the main script. - -## Widget Script Radios - -Radios with color screens and widget scripts such as e.g. FrSky Horus, Jumper T16 and Radiomaster TX16S have fairly large RAM memories, but since all widget scripts present on the SD card are always loaded into memory, they could run out of memory if many big widget scripts are present on the card - even if they are not being used by the selected model. Therefore, large widget scripts should be divided into a small main script and a large loadable part. One way to accomplish this is the following. - -```lua --- main.lua -local name = "" - -local function create(zone, options) - -- Loadable code is called immediately and returns a widget table - return loadScript("/WIDGETS/" .. name .. "/loadable.lua")(zone, options) -end - -local function refresh(widget, event, touchState) - widget.refresh(event, touchState) -end - -local options = { - -- default options here -} - -local function update(widget, options) - widget.update(options) -end - -local function background(widget) - widget.background() -end - -return { - name = name, - create = create, - refresh = refresh, - options = options, - update = update, - background = background -} -``` - -The `create` function loads the file `loadable.lua` in the folder /WIDGETS/\/, and calls it immediately as described in [the previous section](loading-code-modules-dynamically.md). It passes `zone` and `options` as arguments to `loadable.lua`. This scripts adds the functions `refresh`, `update` and (optionally) `background` to the `widget` table: - -```lua --- loadable.lua -local zone, options = ... - --- The widget table will be returned to the main script. -local widget = { } - -function widget.refresh(event, touchState) - -- refresh code here -end - -function widget.update(opt) - options = opt - -- update code here -end - -function widget.background() - -- background code here -end - --- Return to the create(...) function in the main script -return widget -``` - -`zone` and `options` are stored in the [closure](lua-basics.md#closures) of `loadable.lua`, therefore they do not need to be added to the `widget` table, as is commonly done. - -Obviously, the bulk of the widget's code goes in `loadable.lua`, and is only loaded if the widgets is in fact being used. Therefore, if the widget is not used, only the small amount of code in `main.lua` is loaded into the radio's memory. - -For an example of a widget that uses the above design pattern, please have a look at the **EventDemo** widget that is included on the SD card with EdgeTX for color screen radios. diff --git a/part_ii_-_opentx_lua_api_programming_guide/using-key-and-touch-events.md b/part_ii_-_opentx_lua_api_programming_guide/using-key-and-touch-events.md deleted file mode 100644 index a6faa70aa..000000000 --- a/part_ii_-_opentx_lua_api_programming_guide/using-key-and-touch-events.md +++ /dev/null @@ -1,226 +0,0 @@ ---- -description: >- - This section will discuss how interactive scripts receiving user inputs via - key and touch events can be created. ---- - -# Using Key and Touch Events - -The two Lua widgets **EventDemo** and **LibGUI** are provided on the SD card content for color screen radios. EventDemo is just a small widget showing off how key, and especially touch events, can be used. LibGUI contains a globally available library, and a widget showing how the library can be used by other widgets. This section will discuss these two widgets for color screen radios, but generally, what is stated about key events here also applies to the `run` function in Telemetry and One-Time scripts. - -## EventDemo Widget - -This widget uses the design pattern for saving memory by loadable files discussed in the [previous section,](saving-memory.md#widget-script-radios) so all of the action takes place in the file **loadable.lua**. The following code listing is an outline of the `refresh` function with comments explaining what is going on. - -```lua --- This code chunk is loaded on demand by the widget's main script --- when the create(...) function is run. Hence, the body of this --- file is executed by the widget's create(...) function. - --- zone and options were passed as arguments to chunk(...) -local zone, options = ... --- The widget table will be returned to the main script -local widget = { } - -function widget.refresh(event, touchState) - if event == nil then -- Widget mode - -- Draw in widget mode. The size equals zone.w by zone.h - else -- Full screen mode - -- Draw in full screen mode. The size equals LCD_W by LCD_H - if event ~= 0 then -- Do we have an event? - if touchState then -- Only touch events come with a touchState - if event == EVT_TOUCH_FIRST then - -- When the finger first hits the screen - elseif event == EVT_TOUCH_BREAK then - -- When the finger leaves the screen and did not slide on it - elseif event == EVT_TOUCH_TAP then - -- A short tap gives TAP instead of BREAK - -- touchState.tapCount shows number of taps - elseif event == EVT_TOUCH_SLIDE then - -- Sliding the finger gives a SLIDE instead of BREAK or TAP - if touchState.swipeRight then - -- Is true if user swiped right - elseif touchState.swipeLeft then - elseif touchState.swipeUp then - elseif touchState.swipeDown then - -- etc. - else - -- Sliding but not swiping - end - end - else -- event ~= 0 and touchState == nil: key event - if event == EVT_VIRTUAL_ENTER then - -- User hit ENTER - elseif event == EVT_VIRTUAL_EXIT then - -- etc. - end - end - end - end -end -``` - -## LibGUI - -LibGUI was created to support the SoarETX widgets, but it was made separate so everyone can use it, if they so desire. Since it is all Lua, the code is visible for everyone to study and use as is, or modify for their own use (as long as they comply with the terms of the Gnu Public license, of course). - -It is a widget that comes with a global library. Since all widgets are loaded, whether or not they are being used, global functions declared in the body of a widget script will always be available in any widget script in the `create` and `refresh` functions. It is not necessary to setup the widget to use the library, and the only purpose of the widget is to show how `LibGUI` can be used to create widget apps. - -The library is implemented in the [loadable file](saving-memory.md#widget-script-radios) **/WIDGETS/LibGUI/libgui.lua.** The widget that demonstrates how to use the library is implemented in the [loadable file](saving-memory.md#widget-script-radios) **/WIDGETS/LibGUI/loadable.lua**. The file **/WIDGETS/LibGUI/main.lua** contains the standard functions needed for a widget and handles the loading of the two other files. - -The global function `loadGUI()` returns a new `libGUI` object. This object can be used to create new `GUI`objects, which are used to create screens with elements like buttons, menus, labels, numbers etc. - -### libGUI Properties - -`libGUI` has the following properties controlling general settings for the library. - -#### libGUI.flags - -These are default drawing flags to be applied if no flags are given at creation of screen elements. - -**Note:** these flags should not contain color values, as colors are added by the following. - -#### libGUI.colors - -This is a table of the colors used for drawing the GUI elements. These are all theme colors by default, but they can be changed for the `libGUI` instance without changing the theme colors anywhere else. - -| Color | Default value | Used for | -| -------- | ---------------------- | ---------------------------------------------------------------------------- | -| primary1 | COLOR\_THEME\_PRIMARY1 | Text on dropDown menu | -| primary2 | COLOR\_THEME\_PRIMARY2 | Text on buttons and numbers/timers being edited | -| primary3 | COLOR\_THEME\_PRIMARY3 | Text on labels, menus, and numbers/timers | -| focus | COLOR\_THEME\_FOCUS | Background on buttons and numbers/timers being edited. | -| edit | COLOR\_THEME\_EDIT | Background when a value is being edited. | -| active | COLOR\_THEME\_ACTIVE | Background on active toggle buttons and the border around selected elements. | - -#### libGUI.widgetRefresh - -A function `f()` to draw the zone of the screen in widget mode. It takes no arguments. - -### libGUI Functions - -#### libGUI.match(x, ...) - -This is a small utility function that returns `true` if the first argument `x` matches any of the following arguments. It is useful for comparing values of `event`, e.g. if we want to test if the user pressed either of the following buttons, we can use:`libGUI.match(event, EVT_VIRTUAL_ENTER, EVT_VIRTUAL_EXIT, EVT_VIRTUAL_MENU)` - -#### libGUI.newGUI() - -This is the main function that creates a new `GUI` object. If an application has different screens, then a `GUI` object is created for each screen. - -### GUI Object Properties - -#### GUI.fullScreenRefresh - -A function `f()` to draw the screen background in full screen mode. The GUI elements are drawn afterwards on top. - -### GUI Object Functions - -#### GUI.run(event, touchState) - -Redraws the screen and processes key and touch events. It can directly replace a widget's `refresh` function, or it can be called by `refresh`. - -#### GUI.setEventHandler(event, f) - -Sets a function `f(event, touchState)` to handle an event. If no GUI element is being edited, then this can trap events before they are passed to the GUI, e.g. to press EXIT to go back to the previous screen. If `f` is `nil`, then the event handler is removed. - -If the function returns another event value, then it is passed to the active screen element (i.e. the handler can modify certain events). - -It cannot trap the events `EVT_VIRTUAL_PREV`, `EVT_VIRTUAL_NEXT` as these events are used for navigation. If elements are being edited, then this also takes precedence over the event handler. - -#### GUI.showPrompt(guiPrompt) - -This function can be used to show a modal prompt window, or trap events (alternative to `setEventHandler`). `guiPrompt` is a `GUI` or another Lua table with a function `run(event, touchState`). - -When it is set, the main GUI will first be drawn, and then it will call `guiPrompt.run(event, touchState)` instead of its own `onEvent` function. - -#### GUI.dismissPrompt() - -Dismisses the prompt. - -### GUI Screen Elements - -The screen elements are drawn in the order that they are added to the GUI, and touch events are sent to the first element that covers the touched point of the screen. GUI elements therefore should never overlap. - -There are some common properties that can be set for all or most of the GUI elements. - -* `element.disabled = true` prevents the element from taking focus and receiving events, and disabled buttons are greyed out. -* `element.hidden = true` in addition to the above, the element is not drawn. -* `element.title` can be changed for elements with a title. -* `element.value` can be changed for elements with a value. -* `element.flags` drawing flags for the element's text. If no flags were given at element creation, it defaults to `GUI.flags`. - -The various screen elements are added to the GUI with the functions described below. The functions all add the element to the GUI and returns a reference so the element subsequently can be accessed by the client. - -#### GUI.button (x, y, w, h, title, callBack \[, flags]) - -Add a button to the GUI. - -When tapped, it calls `callBack(self)` so a call back function can tell which button activated it. - -#### GUI.toggleButton(x, y, w, h, title, value, callBack \[, flags]) - -Add a toggle button to the GUI. - -The `value` is either `true` or `false`. - -When tapped, it calls `callBack(self)` so a call back function can tell which toggle button activated it, and what `self.value` is. - -#### GUI.number(x, y, w, h, value, changeValue \[, flags]) - -Add an editable number to the GUI. - -The `value` can be either a number or text. By setting the value to a text, it can be shown that the number is not present e.g. by "- -" or similar. - -When tapped, the number will go to edit mode. In edit mode, and `changeValue(d, self)` is called if the increase/decrease buttons are pressed, or a finger is slided up or down from the number. The parameter `d` is the number of "ticks" by which the number is being changed, and `changeValue` must return the new value for the number. In a simple case, the new value would just be `self.value + d`, but it could also select new values from a table etc. - -#### GUI.timer(x, y, w, h, tmr, changeValue \[, flags]) - -Add a timer to the GUI. - -If no `value` is present, then the model timer `tmr` will be shown. If `value` is a number, then it indicates the time in seconds, and it will be shown as **MM:SS**. The `value` can also be text, e.g. "- - : - -" to show that the timer is disabled. - -When tapped, the timer will go to edit mode, as described above for number. - -#### GUI.label(x, y, w, h, title\[, flags]) - -Add a text label to the GUI. - -The label does not respond to any events, but its `title` and `flags` can be changed. - -#### GUI.menu(x, y, w, h, items, callBack \[, flags]) - -Add a scrollable menu to the GUI. - -`items` is a table with the menu item texts. - -When a menu item is tapped, it calls `callBack(self)` and `self.selected` gets the index of the selected item. - -#### GUI.dropDown(x, y, w, h, items, selected, callBack, flags) - -Add a field with values that can be selected on a drop down menu. - -`items` is a table with the items that can be selected from. - -`selected` is the index of the initially selected item. - -When an item has been selected, it calls `callBack(self)`. The index of the selected item is given by `self.selected`. - -#### GUI.gui.horizontalSlider(x, y, w, value, min, max, delta, callBack) - -Adds a horizontal slider that starts at `(x, y)` and has the width `w`. - -`value` is the initial value, and `min - max` is the interval of values that can be selected with step size `delta`. - -When the value is changed, `callBack(self)` is called, and the value is given by `self.value`. - -#### GUI.gui.verticalSlider(x, y, w, value, min, max, delta, callBack) - -The same as the above, just vertical. - -#### gui.custom(self, x, y, w, h) - -This can be used to create your own custom GUI elements. `self` is a table containing the element. You must define the functions `self.draw(focused)` and `self.onEvent(event, touchState)`. There is a function `self.drawFocus(color)` defined that can draw a border around the element (use if focused == true). - -#### gui.gui(x, y, w, h) - -Create a nested sub-GUI. This can be used to group GUI elements which will be offset by `(x, y)` relative to the parent `GUI`. diff --git a/part_iii_-_opentx_lua_api_reference.md b/part_iii_-_opentx_lua_api_reference.md deleted file mode 100644 index 2f1e3745d..000000000 --- a/part_iii_-_opentx_lua_api_reference.md +++ /dev/null @@ -1,3 +0,0 @@ -# Part III - OpenTX Lua API Reference - -This section describes the Lua libraries, functions and constants that are provided by OpenTX. \ No newline at end of file diff --git a/part_iii_-_opentx_lua_api_reference/README.md b/part_iii_-_opentx_lua_api_reference/README.md deleted file mode 100644 index 38b3c70ce..000000000 --- a/part_iii_-_opentx_lua_api_reference/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Part III - EdgeTX Lua API Reference - -This section describes the Lua libraries, functions and constants that are provided by EdgeTX. - diff --git a/part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/README.md b/part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/README.md deleted file mode 100644 index 751cdaae0..000000000 --- a/part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Bitmap Functions - diff --git a/part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/bitmap.resize-bitmap-width-height.md b/part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/bitmap.resize-bitmap-width-height.md deleted file mode 100644 index e81f8ca72..000000000 --- a/part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/bitmap.resize-bitmap-width-height.md +++ /dev/null @@ -1,19 +0,0 @@ -# Bitmap.resize(bitmap, width, height) - -Return a resized bitmap object - -@status current Introduced in 2.8.0 - -**Parameters** - -* `bitmap` (pointer) point to a bitmap previously opened with Bitmap.open() -* `width` (number) the new bitmap width -* `height` (number) the new bitmap height - -**Return value** - -none - -**Notice** - -Only available on Horus diff --git a/part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/bitmap.tomask-bitmap.md b/part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/bitmap.tomask-bitmap.md deleted file mode 100644 index 72e9104a4..000000000 --- a/part_iii_-_opentx_lua_api_reference/bitmap-functions-less-than-greater-than-luadoc-begin-bitmap/bitmap.tomask-bitmap.md +++ /dev/null @@ -1,17 +0,0 @@ -# Bitmap.toMask(bitmap) - -Return a 8bit bitmap mask that can be used with lcd.drawBitmapPattern() - -@status current Introduced in 2.8.0 - -**Parameters** - -* `bitmap` (pointer) point to a bitmap previously opened with Bitmap.open() - -**Return value** - -* `a` bitmap mask - -**Notice** - -Only available on Horus diff --git a/part_iii_-_opentx_lua_api_reference/constants/README.md b/part_iii_-_opentx_lua_api_reference/constants/README.md deleted file mode 100644 index dfd982c95..000000000 --- a/part_iii_-_opentx_lua_api_reference/constants/README.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -description: This section describes various constants that are provided for Lua by EdgeTX. ---- - -# Constants - -* [Key Events](key_events.md) -* [Touch Events](touch-event-constants.md) -* [Flags and Patterns](flags-and-pattern-constants.md) -* [Colors](color-constants.md) -* [Screen size](screen-constants.md) - diff --git a/part_iii_-_opentx_lua_api_reference/constants/color-constants.md b/part_iii_-_opentx_lua_api_reference/constants/color-constants.md deleted file mode 100644 index 4e6558926..000000000 --- a/part_iii_-_opentx_lua_api_reference/constants/color-constants.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -description: >- - On radios with color display, a color may be added to the flags described - above. ---- - -# Color Constants - -There are two types of color constants: one that is an index into a table holding a palette of theme colors, and one that is just a color. - -## Indexed colors - -These are the theme colors plus CUSTOM\_COLOR, and they can be changed with the function lcd.setColor\(color\_index, color\). **Please note: if an indexed color is changed, then it changes everywhere that it is used. For the theme colors, this is not only in other widgets, but everywhere throughout the radio's user interface!** - -* COLOR\_THEME\_PRIMARY1 -* COLOR\_THEME\_PRIMARY2 -* COLOR\_THEME\_PRIMARY3 -* COLOR\_THEME\_SECONDARY1 -* COLOR\_THEME\_SECONDARY2 -* COLOR\_THEME\_SECONDARY3 -* COLOR\_THEME\_FOCUS -* COLOR\_THEME\_EDIT -* COLOR\_THEME\_ACTIVE -* COLOR\_THEME\_WARNING -* COLOR\_THEME\_DISABLED -* CUSTOM\_COLOR - -## Literal colors - -These color constants cannot be changed: - -* BLACK -* WHITE -* LIGHTWHITE -* YELLOW -* BLUE -* DARKBLUE -* GREY -* DARKGREY -* LIGHTGREY -* RED -* DARKRED -* GREEN -* DARKGREEN -* LIGHTBROWN -* DARKBROWN -* BRIGHTGREEN -* ORANGE - -## Deprecated color constants - -These should no longer be used, but they are included for backwards compatibility. The old OpenTX API had a large number of indexed theme colors, and these have been mapped to the new theme colors as follows: - -* ALARM\_COLOR -> COLOR\_THEME\_WARNING -* BARGRAPH\_BGCOLOR -> COLOR\_THEME\_SECONDARY3 -* BARGRAPH1\_COLOR -> COLOR\_THEME\_SECONDARY1 -* BARGRAPH2\_COLOR -> COLOR\_THEME\_SECONDARY2 -* CURVE\_AXIS\_COLOR -> COLOR\_THEME\_SECONDARY2 -* CURVE\_COLOR -> COLOR\_THEME\_SECONDARY1 -* CURVE\_CURSOR\_COLOR -> COLOR\_THEME\_WARNING -* HEADER\_BGCOLOR -> COLOR\_THEME\_FOCUS -* HEADER\_COLOR -> COLOR\_THEME\_SECONDARY1 -* HEADER\_CURRENT\_BGCOLOR -> COLOR\_THEME\_FOCUS -* HEADER\_ICON\_BGCOLOR -> COLOR\_THEME\_SECONDARY1 -* LINE\_COLOR -> COLOR\_THEME\_PRIMARY3 -* MAINVIEW\_GRAPHICS\_COLOR -> COLOR\_THEME\_SECONDARY1 -* MAINVIEW\_PANES\_COLOR -> COLOR\_THEME\_PRIMARY2 -* MENU\_TITLE\_BGCOLOR -> COLOR\_THEME\_SECONDARY1 -* MENU\_TITLE\_COLOR -> COLOR\_THEME\_PRIMARY2 -* MENU\_TITLE\_DISABLE\_COLOR -> COLOR\_THEME\_PRIMARY3 -* OVERLAY\_COLOR -> COLOR\_THEME\_PRIMARY1 -* SCROLLBOX\_COLOR -> COLOR\_THEME\_SECONDARY3 -* TEXT\_BGCOLOR -> COLOR\_THEME\_SECONDARY3 -* TEXT\_COLOR -> COLOR\_THEME\_SECONDARY1 -* TEXT\_DISABLE\_COLOR -> COLOR\_THEME\_DISABLED -* TEXT\_INVERTED\_BGCOLOR -> COLOR\_THEME\_FOCUS -* TEXT\_INVERTED\_COLOR -> COLOR\_THEME\_PRIMARY2 -* TITLE\_BGCOLOR -> COLOR\_THEME\_SECONDARY1 -* TRIM\_BGCOLOR -> COLOR\_THEME\_FOCUS -* TRIM\_SHADOW\_COLOR -> COLOR\_THEME\_PRIMARY1 -* WARNING\_COLOR -> COLOR\_THEME\_WARNING - diff --git a/part_iii_-_opentx_lua_api_reference/constants/flags-and-pattern-constants.md b/part_iii_-_opentx_lua_api_reference/constants/flags-and-pattern-constants.md deleted file mode 100644 index 160117f3b..000000000 --- a/part_iii_-_opentx_lua_api_reference/constants/flags-and-pattern-constants.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -description: >- - Many of the lcd functions accept parameters named flags and patterns. The - names and their meanings are described below. ---- - -# Flags and Pattern Constants - -## Flags - -| Name | Description | Version | Notes | -| :--- | :--- | :--- | :--- | -| 0 | normal font, default precision for numeric | | | -| XXLSIZE | jumbo font | 2.0.6 | | -| DBLSIZE | double size font | | | -| MIDSIZE | mid sized font | | | -| SMLSIZE | small font | | | -| BOLD | bold font | | Only color displays. This is a font size on its own - cannot be combined with other font size flags. | -| SHADOWED | shadow font | | Only color displays | -| INVERS | inverted display | | | -| BLINK | blinking text | | | -| LEFT | left justify | 2.0.6 | Default for most functions not related to bitmaps | -| RIGHT | right justify | | | -| CENTER | center justify | | Only color displays | -| VCENTER | center vertically | 2.5.0 | Only color displays | -| PREC1 | single decimal place | | | -| PREC2 | two decimal places | | | -| GREY\_DEFAULT | grey fill | | | -| TIMEHOUR | display hours | | Only for drawTimer | - -## Patterns - -| Name | Description | -| :--- | :--- | -| FORCE | pixels will be black | -| ERASE | pixels will be white | -| DOTTED | lines will appear dotted | - diff --git a/part_iii_-_opentx_lua_api_reference/constants/key_events.md b/part_iii_-_opentx_lua_api_reference/constants/key_events.md deleted file mode 100644 index 33f682306..000000000 --- a/part_iii_-_opentx_lua_api_reference/constants/key_events.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -description: >- - This page describes the value that is passed to scripts in the event - parameter. It is used in Telemetry and One-Time scripts, as well as widget - scripts in full screen mode. ---- - -# Key Event Constants - -## The key event mechanism - -Each time a key is pressed, held and released a number of events get generated. Here is a typical flow: - -* when a key is pressed a `FIRST` event is generated -* if the key continues to be pressed, then after a while a `LONG` event is generated -* if the key continues to be pressed, then a `REPEAT` events are being generated -* when the key is released a `BREAK` event is generated - -Couple of examples: - -* a short press on key would generate: `FIRST`, `BREAK` -* a longer pres on key would generate: `FIRST`, `LONG`, `BREAK` -* even longer press: `FIRST`, `LONG`, `REPEAT,`REPEAT, ..., `BREAK` - -This normal key event sequence can be altered with the [killEvents(key)](../general-functions-less-than-greater-than-luadoc-begin-general/killevents.md) function. Any time this function is called (after the `FIRST` event) all further key events for this key will be suppressed until the next key press of this key. Examples: - -* kill immediately after the key press would generate: `FIRST` -* kill after the long key press would generate: `FIRST`, `LONG` - -## Constants - -The `event` parameter in the [Telemetry](../../part\_i\_-\_script\_type\_overview/telemetry.md) and [One-Time](https://github.com/opentx/opentx-2-3-lua-reference-guide/tree/0d355d19f1961b689994cf78b84005864d33f9b5/one-time\_scripts.md) scripts run function actually carries two pieces of information: - -* key number -* type of event - -The two fields are combined into one single number. Some of these combinations are defined as constants and are available to Lua scripts: - -| Key Event Name | Comments | -| :---------------: | :---------------------: | -| EVT\_MENU\_BREAK | **MENU** key release | -| EVT\_PAGE\_BREAK | **PAGE** key release | -| EVT\_PAGE\_LONG | **MENU** key long press | -| EVT\_ENTER\_BREAK | **ENT** key release | -| EVT\_ENTER\_LONG | **ENT** key long press | -| EVT\_EXIT\_BREAK | **EXIT** key release | -| EVT\_PLUS\_BREAK | **+** key release | -| EVT\_MINUS\_BREAK | **-** key release | -| EVT\_PLUS\_FIRST | **+** key press | -| EVT\_MINUS\_FIRST | **-** key press | -| EVT\_PLUS\_REPT | **+** key repeat | -| EVT\_MINUS\_REPT | **-** key repeat | - -Radios with rotary encoder (X7 and Horus) have also: - -| Key Event Name | Comments | -| :-------------: | :--------------------------: | -| EVT\_ROT\_BREAK | rotary encoder release | -| EVT\_ROT\_LONG | rotary encoder long press | -| EVT\_ROT\_LEFT | rotary encoder rotated left | -| EVT\_ROT\_RIGHT | rotary encoder rotated right | - -## Virtual events - -Given the large number of radios supported by OpenTX, and the large difference in keys available on those, a set of VIRTUAL KEYS has been defined and are mapped to best fit available hardware - -| Virtual Key Event Name | Comments | -| :-----------------------: | :-------------------: | -| EVT\_VIRTUAL\_NEXT\_PAGE | for PAGE navigation | -| EVT\_VIRTUAL\_PREV\_PAGE | for PAGE navigation | -| EVT\_VIRTUAL\_ENTER | | -| EVT\_VIRTUAL\_ENTER\_LONG | | -| EVT\_VIRTUAL\_MENU | | -| EVT\_VIRTUAL\_MENU\_LONG | | -| EVT\_VIRTUAL\_NEXT | for FIELDS navigation | -| EVT\_VIRTUAL\_NEXT\_REPT | for FIELDS navigation | -| EVT\_VIRTUAL\_PREV | for FIELDS navigation | -| EVT\_VIRTUAL\_PREV\_REPT | for FIELDS navigation | -| EVT\_VIRTUAL\_INC | for VALUES navigation | -| EVT\_VIRTUAL\_INC\_REPT | for VALUES navigation | -| EVT\_VIRTUAL\_DEC | for VALUES navigation | -| EVT\_VIRTUAL\_DEC\_REPT | for VALUES navigation | diff --git a/part_iii_-_opentx_lua_api_reference/constants/logical-switch-function-constants.md b/part_iii_-_opentx_lua_api_reference/constants/logical-switch-function-constants.md deleted file mode 100644 index 69b740c14..000000000 --- a/part_iii_-_opentx_lua_api_reference/constants/logical-switch-function-constants.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -description: These constants give the type of logical switch function. ---- - -# Logical Switch Function Constants - -* LS\_FUNC\_NONE -* LS\_FUNC\_VEQUAL -* LS\_FUNC\_VALMOSTEQUAL -* LS\_FUNC\_VPOS -* LS\_FUNC\_VNEG -* LS\_FUNC\_RANGE -* LS\_FUNC\_APOS -* LS\_FUNC\_ANEG -* LS\_FUNC\_AND -* LS\_FUNC\_OR -* LS\_FUNC\_XOR -* LS\_FUNC\_EDGE -* LS\_FUNC\_EQUAL -* LS\_FUNC\_GREATER -* LS\_FUNC\_LESS -* LS\_FUNC\_DIFFEGREATER -* LS\_FUNC\_ADIFFEGREATER -* LS\_FUNC\_TIMER -* LS\_FUNC\_STICKY diff --git a/part_iii_-_opentx_lua_api_reference/constants/screen-constants.md b/part_iii_-_opentx_lua_api_reference/constants/screen-constants.md deleted file mode 100644 index 7f4e9872a..000000000 --- a/part_iii_-_opentx_lua_api_reference/constants/screen-constants.md +++ /dev/null @@ -1,7 +0,0 @@ -# Screen Constants - -| Name | Description | -| :--- | :--- | -| LCD\_W | width in pixels | -| LCD\_H | height in pixels | - diff --git a/part_iii_-_opentx_lua_api_reference/constants/special-character-constants.md b/part_iii_-_opentx_lua_api_reference/constants/special-character-constants.md deleted file mode 100644 index f6eeae327..000000000 --- a/part_iii_-_opentx_lua_api_reference/constants/special-character-constants.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -description: The radio's special characters can be used with the following text constants. ---- - -# Special Character Constants - -* CHAR\_RIGHT -* CHAR\_LEFT -* CHAR\_UP -* CHAR\_DOWN -* CHAR\_DELTA -* CHAR\_STICK -* CHAR\_POT -* CHAR\_SLIDER -* CHAR\_SWITCH -* CHAR\_TRIM -* CHAR\_INPUT -* CHAR\_FUNCTION -* CHAR\_CYC -* CHAR\_TRAINER -* CHAR\_CHANNEL -* CHAR\_TELEMETRY -* CHAR\_LUA diff --git a/part_iii_-_opentx_lua_api_reference/constants/special-function-constants.md b/part_iii_-_opentx_lua_api_reference/constants/special-function-constants.md deleted file mode 100644 index cddc4220a..000000000 --- a/part_iii_-_opentx_lua_api_reference/constants/special-function-constants.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -description: These constants determine the type of a Special Function ---- - -# Special Function Constants - -* FUNC\_OVERRIDE\_CHANNEL -* FUNC\_TRAINER -* FUNC\_INSTANT\_TRIM -* FUNC\_RESET -* FUNC\_SET\_TIMER -* FUNC\_ADJUST\_GVAR -* FUNC\_VOLUME -* FUNC\_SET\_FAILSAFE -* FUNC\_RANGECHECK -* FUNC\_BIND -* FUNC\_PLAY\_SOUND -* FUNC\_PLAY\_TRACK -* FUNC\_PLAY\_VALUE -* FUNC\_PLAY\_SCRIPT -* FUNC\_RESERVE5 -* FUNC\_BACKGND\_MUSIC -* FUNC\_BACKGND\_MUSIC\_PAUSE -* FUNC\_VARIO -* FUNC\_HAPTIC -* FUNC\_LOGS -* FUNC\_BACKLIGHT -* FUNC\_SCREENSHOT -* FUNC\_RACING\_MODE -* FUNC\_DISABLE\_TOUCH diff --git a/part_iii_-_opentx_lua_api_reference/constants/touch-event-constants.md b/part_iii_-_opentx_lua_api_reference/constants/touch-event-constants.md deleted file mode 100644 index 6e5b6003a..000000000 --- a/part_iii_-_opentx_lua_api_reference/constants/touch-event-constants.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -description: >- - In addition to the key events described in the previous section, radios with a - color touch screen also provide touch events to the widget scripts. ---- - -# Touch Event Constants - -The following touch events are passed in the `event` argument to the widget script `refresh` function \(when in full screen mode\), just like the key events. The following touch events are provided: - -| Touch Event Name | Description | -| :---: | :---: | -| EVT\_TOUCH\_FIRST | When the finger touches down on the screen | -| EVT\_TOUCH\_TAP | If the finger leaves the screen after a quick tap | -| EVT\_TOUCH\_BREAK | If the finger leaves the screen without tap or slide | -| EVT\_TOUCH\_SLIDE | Repeats while the finger is sliding on the screen | - -In addition to the above touch events a `touchState` table is passed to `refresh` with the following addional data fields: - -| touchState fields | Description | -| :---: | :---: | -| x, y | Current touch point | -| startX, startY | Point where slide started | -| slideX, SlideY | Movement since previous SLIDE event \(or start of slide\) | -| swipeUp / swipeDown / swipeLeft / swipeRight | The field is present and equal to `true` if a swipe event occurred in that direction | -| tapCount | Counts the number of consecutive taps | - -## Notes: - -* `touchState` is `nil` if `event` is not a touch event. This can be used to test if we have a touch event or a key event. - * Since Lua evaluates a `nil` value to `false` and everything else to `true`: - * `if touchState then` we have a touch event. -* `x, y` are present for all touch events. -* `startX, startY, slideX, slideY` are only present with `EVT_TOUCH_SLIDE`. -* `swipeUp` / `swipeDown` / `swipeLeft` / `swipeRight` _may_ be present only with`EVT_TOUCH_SLIDE`. -* `tapCount` is zero for anything but `EVT_TOUCH_TAP`. - diff --git a/part_iii_-_opentx_lua_api_reference/constants/widget-options.md b/part_iii_-_opentx_lua_api_reference/constants/widget-options.md deleted file mode 100644 index 352de94a2..000000000 --- a/part_iii_-_opentx_lua_api_reference/constants/widget-options.md +++ /dev/null @@ -1,33 +0,0 @@ -# Widget Options Constants - -There are several option types that can be specified in the widget options table, which are exposed to the user via the Widget Settings menu.\ -\ -For example: - -``` --- Create a table with default options --- Options can be changed by the user from the Widget Settings menu --- Notice that each line is a table inside { } -local options = { - { "Source", SOURCE, 1 }, - -- BOOL is actually not a boolean, but toggles between 0 and 1 - { "Boolean", BOOL, 1 }, - { "Value", VALUE, 1, 0, 10}, - { "Color", COLOR, ORANGE }, - { "Text", STRING, "Max8chrs" } -} - -``` - - - -| Type | Description | -| ---------- | ---------------------------------------------------------------------------------------- | -| COLOR | Displays a color picker, returns a color flag value | -| BOOL | Displays a toggle/checkbox, value toggles between 0 and 1 | -| STRING | Text input option, limited to 8 characters | -| TIMER | Choice option, lets you pick from available timers | -| SOURCE | Choice option, lets you pick from available sources (i.e. sticks, switches, LS) | -| VALUE | Numerical input option, can specify default, min and max value | -| TEXT\_SIZE | Choice option, lets you pick from the available text sizes (i.e. small, large) | -| ALIGNMENT | Choice option, lets you pick from available alignment options (i.e. left, center, right) | diff --git a/part_iii_-_opentx_lua_api_reference/filesystem/README.md b/part_iii_-_opentx_lua_api_reference/filesystem/README.md deleted file mode 100644 index 7a2370799..000000000 --- a/part_iii_-_opentx_lua_api_reference/filesystem/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Filesystem - diff --git a/part_iii_-_opentx_lua_api_reference/filesystem/del-file-or-directory.md b/part_iii_-_opentx_lua_api_reference/filesystem/del-file-or-directory.md deleted file mode 100644 index 2a021fc24..000000000 --- a/part_iii_-_opentx_lua_api_reference/filesystem/del-file-or-directory.md +++ /dev/null @@ -1,21 +0,0 @@ -# del(file or directory) - -@status current Introduced in 2.9.0 - -## Example - -```lua - if del("/SCRIPTS/TOOLS/deleteme.txt") == 0 then - -- successfully deleted file - else - -- failed to delete file - end -``` - -### Parameters - -Path to file or directory to be deleted - -### Return value - -Returns FRESULT (e.g. 0=OK, 4=File not found, 5=Path not found, 6=Path invalid) diff --git a/part_iii_-_opentx_lua_api_reference/filesystem/dir-directory.md b/part_iii_-_opentx_lua_api_reference/filesystem/dir-directory.md deleted file mode 100644 index 57c36e2d5..000000000 --- a/part_iii_-_opentx_lua_api_reference/filesystem/dir-directory.md +++ /dev/null @@ -1,24 +0,0 @@ -# dir\(directory\) - -Return an iterator listing all the files and directories name in a directory - -@status current Introduced in 2.5.0 - -**Parameters** - -* `directory` \(string\) Working directory - -**Return value** - -none - -#### Example - -```lua - local var y = 40 - for fname in dir("/SCRIPTS") do - lcd.drawText(5,y, fname, TEXT_COLOR) - y = y + 20 - end -``` - diff --git a/part_iii_-_opentx_lua_api_reference/filesystem/fstat-path.md b/part_iii_-_opentx_lua_api_reference/filesystem/fstat-path.md deleted file mode 100644 index 6ad5aa528..000000000 --- a/part_iii_-_opentx_lua_api_reference/filesystem/fstat-path.md +++ /dev/null @@ -1,41 +0,0 @@ -# fstat\(path\) - -Checks the existence of file or directory. -If not exist, return nil. -If exist, return the object information. - -@status current Introduced in 2.5.0 - -**Parameters** - -* `path` \(string\) path to the object - -**Return value** - -* `table` object info, table elements: -* `size` \(number\) file size -* `attrib` \(number\) file attribute flags -* `time` \(table\) table with last time modified date and times, table elements: - * `year` \(number\) year - * `mon` \(number\) month - * `day` \(number\) day of month - * `hour` \(number\) hours - * `hour12` \(number\) hours in US format - * `min` \(number\) minutes - * `sec` \(number\) seconds - * `suffix` \(text\) am or pm - -#### Example - -```lua - info = fstat("radio") - if info ~= nil then - if (info.attrib == AM_DIR) then - print("is a directory") - end - - size = info.size - time = info.time - end -``` - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/README.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/README.md deleted file mode 100644 index 0a55ad401..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# General Functions - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/accesstelemetrypush.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/accesstelemetrypush.md deleted file mode 100644 index bf180de75..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/accesstelemetrypush.md +++ /dev/null @@ -1,21 +0,0 @@ -# accessTelemetryPush\(\) - -This functions allows for sending SPORT / ACCESS telemetry data toward the receiver, and more generally, to anything connected SPORT bus on the receiver or transmitter. - -When called without parameters, it will only return the status of the output buffer without sending anything. - -@status current Introduced in 2.3 - -## Parameters - -* `module` module index \(0 = internal, 1 = external\) -* `rxUid` receiver index -* `sensorId` physical sensor ID -* `frameId` frame ID -* `dataId` data ID -* `value` value - -## Return value - -* `boolean` data queued in output buffer or not. - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/chdir.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/chdir.md deleted file mode 100644 index ecb58c5db..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/chdir.md +++ /dev/null @@ -1,14 +0,0 @@ -# chdir\(directory\) - -Change the working directory - -@status current Introduced in 2.3.0 - -## Parameters - -* `directory` \(string\) New working directory - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/crossfiretelemetrypop.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/crossfiretelemetrypop.md deleted file mode 100644 index 75e7b25eb..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/crossfiretelemetrypop.md +++ /dev/null @@ -1,17 +0,0 @@ -# crossfireTelemetryPop\(\) - -Pops a received Crossfire Telemetry packet from the queue. - -@status current Introduced in 2.2.0 - -## Parameters - -none - -## Return value - -* `nil` queue does not contain any \(or enough\) bytes to form a whole packet -* `multiple` returns 2 values: - * command \(number\) - * packet \(table\) data bytes - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/crossfiretelemetrypush.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/crossfiretelemetrypush.md deleted file mode 100644 index ad1c146a7..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/crossfiretelemetrypush.md +++ /dev/null @@ -1,18 +0,0 @@ -# crossfireTelemetryPush\(\) - -This functions allows for sending telemetry data toward the TBS Crossfire link. - -When called without parameters, it will only return the status of the output buffer without sending anything. - -@status current Introduced in 2.2.0, retval nil added in 2.3.4 - -## Parameters - -* `command` command -* `data` table of data bytes - -## Return value - -* `boolean` data queued in output buffer or not. -* `nil` incorrect telemetry protocol. - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/defaultchannel.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/defaultchannel.md deleted file mode 100644 index 8b0668905..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/defaultchannel.md +++ /dev/null @@ -1,15 +0,0 @@ -# defaultChannel\(stick\) - -Get channel assigned to stick. See Default Channel Order in General Settings - -@status current Introduced in 2.0.0 - -## Parameters - -* `stick` \(number\) stick number \(from 0 to 3\) - -## Return value - -* `number` channel assigned to this stick \(from 0 to 3\) -* `nil` stick not found - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/defaultstick.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/defaultstick.md deleted file mode 100644 index 8a81314b9..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/defaultstick.md +++ /dev/null @@ -1,14 +0,0 @@ -# defaultStick\(channel\) - -Get stick that is assigned to a channel. See Default Channel Order in General Settings. - -@status current Introduced in 2.0.0 - -## Parameters - -* `channel` \(number\) channel number \(0 means CH1\) - -## Return value - -* `number` Stick assigned to this channel \(from 0 to 3\) - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/flushaudio.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/flushaudio.md deleted file mode 100644 index f2ee847a5..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/flushaudio.md +++ /dev/null @@ -1,13 +0,0 @@ -# flushAudio() - -Flushes audio queue - -@status experimental, Introduced in 2.8.0 - -**Parameters** - -none - -**Return value** - -none diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getavailablememory.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getavailablememory.md deleted file mode 100644 index eabeda44a..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getavailablememory.md +++ /dev/null @@ -1,12 +0,0 @@ -# getAvailableMemory\(\) - -Get available memory remaining in the Heap for Lua. - -## Parameters - -none - -## Return value - -* `usage` \(number\) a value returned in b - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getdatetime.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getdatetime.md deleted file mode 100644 index 65be5d530..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getdatetime.md +++ /dev/null @@ -1,20 +0,0 @@ -# getDateTime\(\) - -Return current system date and time that is kept by the RTC unit - -## Parameters - -none - -## Return value - -* `table` current date and time, table elements: - * `year` \(number\) year - * `mon` \(number\) month - * `day` \(number\) day of month - * `hour` \(number\) hours - * `hour12` \(number\) hours in US format - * `min` \(number\) minutes - * `sec` \(number\) seconds - * `suffix` \(text\) am or pm - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getfieldinfo.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getfieldinfo.md deleted file mode 100644 index fdff705e1..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getfieldinfo.md +++ /dev/null @@ -1,27 +0,0 @@ -# getFieldInfo(source) - -Return detailed information about field (source) - -The list of valid sources is available: - -| OpenTX Version | Radio | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| 2.0 | [all](http://downloads-20.open-tx.org/firmware/lua\_fields.txt) | -| 2.1 | [X9D and X9D+](http://downloads-21.open-tx.org/firmware/lua\_fields\_taranis.txt), [X9E](http://downloads-21.open-tx.org/firmware/lua\_fields\_taranis\_x9e.txt) | -| 2.2 | [X9D and X9D+](http://downloads.open-tx.org/2.2/release/firmware/lua\_fields\_x9d.txt), [X9E](http://downloads.open-tx.org/2.2/release/firmware/lua\_fields\_x9e.txt), [Horus](http://downloads.open-tx.org/2.2/release/firmware/lua\_fields\_x12s.txt) | -| 2.3 | [X9D and X9D+](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x9d.txt), [X9E](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x9e.txt), [X7](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x7.txt), [Horus](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x12s.txt) | - -@status current Introduced in 2.0.8, 'unit' field added in 2.2.0 - -## Parameters - -* `source` can be an identifier (number) or a name (string) of the source. - -## Return value - -* `table` information about requested field, table elements: - * `id` (number) field identifier - * `name` (string) field name - * `desc` (string) field description - * 'unit' (number) unit identifier [Full list](../../appendix/units.md) -* `nil` the requested field was not found diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getflightmode.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getflightmode.md deleted file mode 100644 index 3f64688fa..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getflightmode.md +++ /dev/null @@ -1,18 +0,0 @@ -# getFlightMode\(mode\) - -Return flight mode data. - -@status current Introduced in 2.1.7 - -## Parameters - -* `mode` \(number\) flight mode number to return \(0 - 8\). If mode parameter - - is not specified \(or contains invalid value\), then the current flight mode data is returned. - -## Return value - -* `multiple` returns 2 values: - * \(number\) \(current\) flight mode number \(0 - 8\) - * \(string\) \(current\) flight mode name - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getgeneralsettings.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getgeneralsettings.md deleted file mode 100644 index 9a00e30b3..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getgeneralsettings.md +++ /dev/null @@ -1,24 +0,0 @@ -# getGeneralSettings\(\) - -Returns \(some of\) the general radio settings - -@status current Introduced in 2.0.6, `imperial` added in TODO, `language` and `voice` added in 2.2.0, gtimer added in 2.2.2. - -## Parameters - -none - -## Return value - -* `table` with elements: - * `battWarn` \(number\) radio battery range - warning value - * `battMin` \(number\) radio battery range - minimum value - * `battMax` \(number\) radio battery range - maximum value - * `imperial` \(number\) set to a value different from 0 if the radio is set to the - - IMPERIAL units - - * `language` \(string\) radio language \(used for menus\) - * `voice` \(string\) voice language \(used for speech\) - * `gtimer` \(number\) radio global timer in seconds \(does not include current session\) - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getglobaltimer.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getglobaltimer.md deleted file mode 100644 index 13f810dae..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getglobaltimer.md +++ /dev/null @@ -1,18 +0,0 @@ -# getGlobalTimer\(\) - -Returns radio timers - -@status current Introduced added in 2.3.0. - -## Parameters - -none - -## Return value - -* `table` with elements: -* `gtimer` \(number\) radio global timer in seconds -* `session` \(number\) radio session in seconds -* `ttimer` \(number\) radio throttle timer in seconds -* `tptimer` \(number\) radio throttle percent timer in seconds - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getlogicalswitchvalue-id.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getlogicalswitchvalue-id.md deleted file mode 100644 index 17bfcab2a..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getlogicalswitchvalue-id.md +++ /dev/null @@ -1,13 +0,0 @@ -# getLogicalSwitchValue(id) - -Reads the value of a logical switch. - -@status current Introduced in 2.6 - -## Parameter - -* `id`: integer identifying the logical switch (zero for L01 etc.). - -## Return value - -* `value`: true/false. diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getoutputvalue-outputindex.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getoutputvalue-outputindex.md deleted file mode 100644 index a6f42cd96..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getoutputvalue-outputindex.md +++ /dev/null @@ -1,12 +0,0 @@ -# getOutputValue(outputIndex) - -@status current Introduced in 2.8.0 - -**Parameters** - -* `outputIndex:` integer identifying the output channel number 0 for CH1, up to MAX\_OUTPUT\_CHANNELS - 1. - -**Return value** - -* `value` current output value (number). Zero is returned for: -* non-existing outputs diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getras.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getras.md deleted file mode 100644 index a8a2bb442..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getras.md +++ /dev/null @@ -1,20 +0,0 @@ -# getRAS\(\) - -Return the RAS value or nil if no valid hardware found - -@status current Introduced in 2.2.0 - -## Parameters - -none - -## Return value - -* `number` representing RAS value. Value bellow 0x33 \(51 decimal\) are all ok, value above 0x33 indicate a hardware antenna issue. - - This is just a hardware pass/fail measure and does not represent the quality of the radio link - -### Notice - -RAS was called SWR in the past - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrotencmode.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrotencmode.md deleted file mode 100644 index d3bebe4f7..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrotencmode.md +++ /dev/null @@ -1,14 +0,0 @@ -# getRotEncMode() - -Return rotary encoder mode - -@status current Introduced in 2.8.0 - -**Parameters** - -none - -**Return value** - -* `number` in list: Normal = 0, Both V and H inverted = 1, V-N = 2, V-A = 3 -* `return 0` on radio without rotary encoder diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrotencspeed.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrotencspeed.md deleted file mode 100644 index 5638024b6..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrotencspeed.md +++ /dev/null @@ -1,14 +0,0 @@ -# getRotEncSpeed() - -Return rotary encoder current speed - -@status current Introduced in 2.3.10 - -## Parameters - -none - -## Return value - -* `number` in list: ROTENC\_LOWSPEED, ROTENC\_MIDSPEED, ROTENC\_HIGHSPEED -* `return 0` on radio without rotary encoder diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrssi.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrssi.md deleted file mode 100644 index e9e453f46..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrssi.md +++ /dev/null @@ -1,16 +0,0 @@ -# getRSSI\(\) - -Get RSSI value as well as low and critical RSSI alarm levels \(in dB\) - -@status current Introduced in 2.2.0 - -## Parameters - -none - -## Return value - -* `rssi` RSSI value \(0 if no link\) -* `alarm_low` Configured low RSSI alarm level -* `alarm_crit` Configured critical RSSI alarm level - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrtctime.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrtctime.md deleted file mode 100644 index dc0f24e7d..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getrtctime.md +++ /dev/null @@ -1,14 +0,0 @@ -# getRtcTime\(\) - -Return current RTC system date as unix timstamp \(in seconds since 1. Jan 1970\) - -Please note the RTC timestamp is kept internally as a 32bit integer, which will overflow in 2038. - -## Parameters - -none - -## Return value - -* `number` Number of seconds elapsed since 1. Jan 1970 - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getshmvar-id.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getshmvar-id.md deleted file mode 100644 index 078b07183..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getshmvar-id.md +++ /dev/null @@ -1,17 +0,0 @@ -# getShmVar(id) - -Gets the value of a shared memory variable that can be used for passing data between Lua widgets and other Lua scripts. - -@status current Introduced in 2.6 - -**Parameters** - -* `id:` integer between 1 and 16 identifying the shared memory variable. - -**Return value** - -* `value:` integer. The value of the shared memory variable. - -**Notice** - -Only available on radios with color display diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getsourceindex-sourcename.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getsourceindex-sourcename.md deleted file mode 100644 index 2301309e2..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getsourceindex-sourcename.md +++ /dev/null @@ -1,19 +0,0 @@ -# getSourceIndex(sourceName) - -#### Parameters - -* `sourceName`: string naming a value source as it is shown on radio menus where you can select it. Notice that many names have [special characters](../constants/special-character-constants.md) in them. - -Return value - -* `sourceIndex`: integer. The source index, which can be used as input for `getSourceName(sourceIndex)`, `getValue(sourceIndex)`, and `getFieldInfo(sourceIndex)`. - -#### Notice - -The source names shown on the screen are not the same as the names used by `getFieldInfo` and `getValue`. But the indices are the same, so e.g. `getValue(index)` will work with the indices obtained here. - -This function is rather time consuming, and should not be used repeatedly in a script, if it can be avoided. - -#### Status - -Current Introduced in 2.6 diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getsourcename-sourceindex.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getsourcename-sourceindex.md deleted file mode 100644 index 7e8ef040a..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getsourcename-sourceindex.md +++ /dev/null @@ -1,17 +0,0 @@ -# getSourceName(sourceIndex) - -#### Parameters - -* `sourceIndex`: integer identifying a value source as returned by `getSourceIndex(sourceName)` or the `id` field in the table returned by `getFieldInfo`. - -#### Return value - -* `sourceName`: string naming the value source as it is shown on radio menus where a source can be chosen. - -#### Notice - -The source names shown on the screen are not the same as the names used by `getFieldInfo` and `getValue`. But the indices are the same, so e.g. `getValue(index)` will work with the indices used here. - -#### Status - -Current Introduced in 2.6 diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getsourcevalue-source.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getsourcevalue-source.md deleted file mode 100644 index 551a95d5a..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getsourcevalue-source.md +++ /dev/null @@ -1,51 +0,0 @@ -# getSourceValue(source) - -Returns the value of a source. Supersedes `getValue`. - -The list of fixed sources: - -| OpenTX Version | Radio | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| 2.0 | [all](http://downloads-20.open-tx.org/firmware/lua\_fields.txt) | -| 2.1 | [X9D and X9D+](http://downloads-21.open-tx.org/firmware/lua\_fields\_taranis.txt), [X9E](http://downloads-21.open-tx.org/firmware/lua\_fields\_taranis\_x9e.txt) | -| 2.2 | [X9D and X9D+](http://downloads.open-tx.org/2.2/release/firmware/lua\_fields\_x9d.txt), [X9E](http://downloads.open-tx.org/2.2/release/firmware/lua\_fields\_x9e.txt), [Horus](http://downloads.open-tx.org/2.2/release/firmware/lua\_fields\_x12s.txt) | -| 2.3 | [X9D and X9D+](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x9d.txt), [X9E](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x9e.txt), [X7](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x7.txt), [Horus](http://downloads.open-tx.org/2.3/release/firmware/lua\_fields\_x12s.txt) | - -In OpenTX 2.1.x the telemetry sources no longer have a predefined name. To get a telemetry value simply use it's sensor name. For example: - -* Altitude sensor has a name "Alt" -* to get the current altitude use the source "Alt" -* to get the minimum altitude use the source "Alt-", to get the maximum use "Alt+" - -value is nil for non-existing sources. all non-allowed sensors while FAI MODE is active, or if a telemetry item value has never been received - -value is a table for GPS position: - -* `lat` (number) latitude, positive is North -* `lon` (number) longitude, positive is East -* `pilot-lat` (number) pilot latitude, positive is North -* `pilot-lon` (number) pilot longitude, positive is East - -value is a table for date/time, see getDateTime() - -value is a table for battery cells(except where no cells were detected in which case the returned value is 0): - -* table has one item for each detected cell: -* key (number) cell number (1 to number of cells) -* value (number) current cell voltage - -@status current Introduced in 2.8.0 - -### Parameters - -* `source` can be an index (number) (which was obtained by `getFieldInfo` or `getSourceIndex`) or a name (string) of the source. - -### Return value - -* `value` current source value (number), or last known telemetry item value. -* `isCurrent` is true for telemetry sources that are within the "Sensor Lost" duration and telemetry is streaming . Always true for non-telemetry items. -* `isFresh` is true for telemetry sources which have been recently updated and telemetry is streaming. Always true for non-telemetry items. - -#### Notice - -Getting a value by its numerical identifier is much faster than by its name. While `Cels` sensor returns current values of all cells in a table, a `Cels+` or `Cels-` will return a single value - the maximum or minimum Cels value. diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchindex-positionname.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchindex-positionname.md deleted file mode 100644 index ab90b916d..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchindex-positionname.md +++ /dev/null @@ -1,11 +0,0 @@ -# getSwitchIndex(positionName) - -@status current Introduced in 2.6 - -## Parameters - -* `positionName`: string naming a switch position as it is shown on radio menus where you can select a switch. Notice that many names have special characters in them like arrow up/down etc. (see [Special Character Constants](../constants/special-character-constants.md)). - -## Return value - -* value: integer. The switchIndex, which can be used as input for \`getSwitchName(switchIndex)\` and \`getSwitchValue(switchIndex)\`. Also corresponds to the fields in the table returned by \`model.getLogicalSwitch(switch)\` identifying switches. diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchname-switchindex.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchname-switchindex.md deleted file mode 100644 index 9aa2337f9..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchname-switchindex.md +++ /dev/null @@ -1,11 +0,0 @@ -# getSwitchName(switchIndex) - -@status current Introduced in 2.6 - -## Parameter - -* `switchIndex`: integer identifying a switch as returned by `getSwitchIndex(positionName)` or fields in the table returned by `model.getLogicalSwitch(switch)` identifying switches. - -## Return value - -* value: string naming the switch position as it is shown on radio menus where a switch can be chosen. diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchvalue-switchindex.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchvalue-switchindex.md deleted file mode 100644 index 188be9d4b..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getswitchvalue-switchindex.md +++ /dev/null @@ -1,12 +0,0 @@ -# getSwitchValue(switchIndex) - -@status current Introduced in 2.6 - -## Parameter - -* `switchIndex`: integer identifying a switch as returned by `getSwitchIndex(positionName)` or fields in the table returned by `model.getLogicalSwitch(switch)` identifying switches. - -## Return value - -* `value`: true/false. The value of the switch. - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/gettime.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/gettime.md deleted file mode 100644 index 43dfb94dd..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/gettime.md +++ /dev/null @@ -1,18 +0,0 @@ -# getTime\(\) - -Return the time since the radio was started in multiple of 10ms - -The timer internally uses a 32-bit counter which is enough for 497 days so overflows will not happen. - -@status current Introduced in 2.0.0 - -## Parameters - -none - -## Return value - -* `number` Number of 10ms ticks since the radio was started Example: - - run time: 12.54 seconds, return value: 1254 - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/gettxgps.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/gettxgps.md deleted file mode 100644 index 001fdae0a..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/gettxgps.md +++ /dev/null @@ -1,22 +0,0 @@ -# getTxGPS\(\) - -Return the internal GPS position or nil if no valid hardware found - -@status current Introduced in 2.2.2 - -## Parameters - -none - -## Return value - -* `table` representing the current radio position - * `lat` \(number\) internal GPS latitude, positive is North - * `lon` \(number\) internal GPS longitude, positive is East - * 'numsat' \(number\) current number of sats locked in by the GPS sensor - * 'fix' \(boolean\) fix status - * 'alt' \(number\) internal GPS altitude in 0.1m - * 'speed' \(number\) internal GPSspeed in 0.1m/s - * 'heading' \(number\) internal GPS ground course estimation in degrees \* 10 - * 'hdop' \(number\) internal GPS horizontal dilution of precision - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getusage.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getusage.md deleted file mode 100644 index d7d7018ea..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getusage.md +++ /dev/null @@ -1,14 +0,0 @@ -# getUsage\(\) - -Get percent of already used Lua instructions in current script execution cycle. - -@status current Introduced in 2.2.1 - -## Parameters - -none - -## Return value - -* `usage` \(number\) a value from 0 to 100 \(percent\) - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getvalue.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getvalue.md deleted file mode 100644 index 885578d89..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getvalue.md +++ /dev/null @@ -1,48 +0,0 @@ -# getValue\(source\) - -Returns the value of a source. - -The list of fixed sources: - -| OpenTX Version | Radio | -| :--- | :--- | -| 2.0 | [all](http://downloads-20.open-tx.org/firmware/lua_fields.txt) | -| 2.1 | [X9D and X9D+](http://downloads-21.open-tx.org/firmware/lua_fields_taranis.txt), [X9E](http://downloads-21.open-tx.org/firmware/lua_fields_taranis_x9e.txt) | -| 2.2 | [X9D and X9D+](http://downloads.open-tx.org/2.2/release/firmware/lua_fields_x9d.txt), [X9E](http://downloads.open-tx.org/2.2/release/firmware/lua_fields_x9e.txt), [Horus](http://downloads.open-tx.org/2.2/release/firmware/lua_fields_x12s.txt) | -| 2.3 | [X9D and X9D+](http://downloads.open-tx.org/2.3/release/firmware/lua_fields_x9d.txt), [X9E](http://downloads.open-tx.org/2.3/release/firmware/lua_fields_x9e.txt), [X7](http://downloads.open-tx.org/2.3/release/firmware/lua_fields_x7.txt), [Horus](http://downloads.open-tx.org/2.3/release/firmware/lua_fields_x12s.txt) | - -In OpenTX 2.1.x the telemetry sources no longer have a predefined name. To get a telemetry value simply use it's sensor name. For example: - -* Altitude sensor has a name "Alt" -* to get the current altitude use the source "Alt" -* to get the minimum altitude use the source "Alt-", to get the maximum use "Alt+" - -@status current Introduced in 2.0.0, changed in 2.1.0, `Cels+` and `Cels-` added in 2.1.9 - -## Parameters - -* `source` can be an identifier \(number\) \(which was obtained by the getFieldInfo\(\)\) - - or a name \(string\) of the source. - -## Return value - -* `value` current source value \(number\). Zero is returned for: - * non-existing sources - * for all telemetry source when the telemetry stream is not received - * far all non allowed sensors while FAI MODE is active -* `table` GPS position is returned in a table: - * `lat` \(number\) latitude, positive is North - * `lon` \(number\) longitude, positive is East - * `pilot-lat` \(number\) pilot latitude, positive is North - * `pilot-lon` \(number\) pilot longitude, positive is East -* `table` GPS date/time, see getDateTime\(\) -* `table` Cells are returned in a table \(except where no cells were detected in which case the returned value is 0\): - * table has one item for each detected cell: - * key \(number\) cell number \(1 to number of cells\) - * value \(number\) current cell voltage - -### Notice - -Getting a value by its numerical identifier is faster then by its name. While `Cels` sensor returns current values of all cells in a table, a `Cels+` or `Cels-` will return a single value - the maximum or minimum Cels value. - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getversion.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getversion.md deleted file mode 100644 index f4ad0d1c9..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/getversion.md +++ /dev/null @@ -1,57 +0,0 @@ -# getVersion\(\) - -Return OpenTX version - -@status current Introduced in 2.0.0, expanded in 2.1.7, radio type strings changed in 2.2.0, os name added in EdgeTX 2.4.0 - -## Example - -This example also runs in OpenTX versions where the function returned only one value: - -```lua -local function run(event) - local ver, radio, maj, minor, rev, osname = getVersion() - print("version: "..ver) - if radio then print ("radio: "..radio) end - if maj then print ("maj: "..maj) end - if minor then print ("minor: "..minor) end - if rev then print ("rev: "..rev) end - if osname then print ("osname: "..osname) end - return 1 -end - -return { run=run } -``` - -Output of the above script in simulator: - -```text -version: 2.4.0 -radio: tx16s-simu -maj: 2 -minor: 4 -rev: 0 -osname: EdgeTX -``` - -### Parameters - -none - -### Return value - -* `string` OpenTX version \(ie "2.1.5"\) -* `multiple` values \(available since 2.1.7\): - * \(string\) OpenTX version \(ie "2.1.5"\) - * \(string\) radio type: `x12s`, `x10`, `x9e`, `x9d+`, `x9d` or `x7`. - - If running in simulator the "-simu" is added - - * \(number\) major version \(ie 2 if version 2.1.5\) - * \(number\) minor version \(ie 1 if version 2.1.5\) - * \(number\) revision number \(ie 5 if version 2.1.5\) - - Since EdgeTX 2.4.0, sixth value added - - * \(string\) OS name \(i.e. EdgeTX or nil if OpenTX\) - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/ghosttelemetrypop.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/ghosttelemetrypop.md deleted file mode 100644 index ee64aef86..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/ghosttelemetrypop.md +++ /dev/null @@ -1,16 +0,0 @@ -# ghostTelemetryPop() - -Pops a received Ghost Telemetry packet from the queue. - -@status current Introduced in 2.7.0 - -**Parameters** - -none - -**Return value** - -* `nil` queue does not contain any (or enough) bytes to form a whole packet -* `multiple` returns 2 values: -* type (number) -* packet (table) data bytes diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/ghosttelemetrypush.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/ghosttelemetrypush.md deleted file mode 100644 index 56fcbcec9..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/ghosttelemetrypush.md +++ /dev/null @@ -1,17 +0,0 @@ -# ghostTelemetryPush() - -This functions allows for sending telemetry data toward the Ghost link. - -When called without parameters, it will only return the status of the output buffer without sending anything. - -@status current Introduced in 2.7.0 - -**Parameters** - -* `command` command -* `data` table of data bytes - -**Return value** - -* `boolean` data queued in output buffer or not. -* `nil` incorrect telemetry protocol. diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/grey.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/grey.md deleted file mode 100644 index 936ac3f37..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/grey.md +++ /dev/null @@ -1,18 +0,0 @@ -# GREY\(\) - -Returns gray value which can be used in LCD functions - -@status current Introduced in 2.0.13 - -## Parameters - -none - -## Return value - -* `(number)` a value that represents amount of _greyness_ \(from 0 to 15\) - -### Notice - -Only available on Taranis - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/killevents.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/killevents.md deleted file mode 100644 index b1dc9d01d..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/killevents.md +++ /dev/null @@ -1,14 +0,0 @@ -# killEvents\(key\) - -Stops key state machine. See [Key Events](https://github.com/EdgeTX/lua-reference-guide/tree/fe42fe461fcccd828fba5d218da01336e4f7b0cd/part_iii_-_opentx_lua_api_reference/key_events.md) for the detailed description. - -@status current Introduced in 2.0.0 - -## Parameters - -* `key` \(number\) key to be killed, can also include event type \(only the key part is used\) - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/loadscript.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/loadscript.md deleted file mode 100644 index c36f755c0..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/loadscript.md +++ /dev/null @@ -1,49 +0,0 @@ -# loadScript\(file \[, mode\], \[,env\]\) - -Load a Lua script file. This is similar to Lua's own [loadfile\(\)](https://www.lua.org/manual/5.2/manual.html#pdf-loadfile) API method, but it uses OpenTx's optional pre-compilation feature to save memory and time during load. - -Return values are same as from Lua API loadfile\(\) method: If the script was loaded w/out errors then the loaded script \(or "chunk"\) is returned as a function. Otherwise, returns nil plus the error message. - -@status current Introduced in 2.2.0 - -## Example - -```lua - fun, err = loadScript("/SCRIPTS/FUNCTIONS/print.lua") - if (fun ~= nil) then - fun("Hello from loadScript()") - else - print(err) - end -``` - -### Parameters - -* `file` \(string\) Full path and file name of script. The file extension is optional and ignored \(see `mode` param to control which extension will be used\). However, if an extension is specified, it should be ".lua" \(or ".luac"\), otherwise it is treated as part of the file name and the .lua/.luac will be appended to that. -* `mode` \(string\) \(optional\) Controls whether to force loading the text \(.lua\) or pre-compiled binary \(.luac\) version of the script. By default OTx will load the newest version and compile a new binary if necessary \(overwriting any existing .luac version of the same script, and stripping some debug info like line numbers\). You can use `mode` to control the loading behavior more specifically. Possible values are: - * `b` only binary. - * `t` only text. - * `T` \(default on simulator\) prefer text but load binary if that is the only version available. - * `bt` \(default on radio\) either binary or text, whichever is newer \(binary preferred when timestamps are equal\). - * Add `x` to avoid automatic compilation of source file to .luac version. - - Eg: "tx", "bx", or "btx". - - * Add `c` to force compilation of source file to .luac version \(even if existing version is newer than source file\). - - Eg: "tc" or "btc" \(forces "t", overrides "x"\). - - * Add `d` to keep extra debug info in the compiled binary. - - Eg: "td", "btd", or "tcd" \(no effect with just "b" or with "x"\). -* `env` \(integer\) See documentation for Lua function loadfile\(\). - -### Return value - -* `function` The loaded script, or `nil` if there was an error \(e.g. file not found or syntax error\). -* `string` Error message\(s\), if any. Blank if no error occurred. - -#### Notice - -Note that you will get an error if you specify `mode` as "b" or "t" and that specific version of the file does not exist \(eg. no .luac file when "b" is used\). Also note that `mode` is NOT passed on to Lua's loader function, so unlike with loadfile\(\) the actual file content is not checked \(as if no mode or "bt" were passed to loadfile\(\)\). - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/multibuffer.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/multibuffer.md deleted file mode 100644 index 6f911ebd3..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/multibuffer.md +++ /dev/null @@ -1,16 +0,0 @@ -# multiBuffer\(address\[,value\]\) - -This function reads/writes the Multi protocol buffer to interact with a protocol². - -@status current Introduced in 2.3.2 - -## Parameters - -* `address` to read/write in the buffer - - @param \(optional\): value to write in the buffer - -## Return value - -* `buffer` value \(number\) - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playduration.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playduration.md deleted file mode 100644 index 275150d5a..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playduration.md +++ /dev/null @@ -1,17 +0,0 @@ -# playDuration\(duration \[, hourFormat\]\) - -Play a time value \(text to speech\) - -@status current Introduced in 2.1.0 - -## Parameters - -* `duration` \(number\) number of seconds to play. Only integral part is used. -* `hourFormat` \(number\): - * `0 or not present` play format: minutes and seconds. - * `!= 0` play format: hours, minutes and seconds. - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playfile.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playfile.md deleted file mode 100644 index 77e24c78f..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playfile.md +++ /dev/null @@ -1,18 +0,0 @@ -# playFile\(name\) - -Play a file from the SD card - -@status current Introduced in 2.0.0, changed in 2.1.0 - -## Parameters - -* `path` \(string\) full path to wav file \(i.e. “/SOUNDS/en/system/tada.wav”\) - - Introduced in 2.1.0: If you use a relative path, the current language is appended - - to the path \(example: for English language: `/SOUNDS/en` is appended\) - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playhaptic.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playhaptic.md deleted file mode 100644 index 57c1f75b8..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playhaptic.md +++ /dev/null @@ -1,18 +0,0 @@ -# playHaptic\(duration, pause \[, flags\]\) - -Generate haptic feedback - -@status current Introduced in 2.2.0 - -## Parameters - -* `duration` \(number\) length of the haptic feedback in milliseconds -* `pause` \(number\) length of the silence after haptic feedback in milliseconds -* `flags` \(number\): - * `0 or not present` play with normal priority - * `PLAY_NOW` play immediately - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playnumber.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playnumber.md deleted file mode 100644 index 4e160e3ad..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playnumber.md +++ /dev/null @@ -1,19 +0,0 @@ -# playNumber\(value, unit \[, attributes\]\) - -Play a numerical value \(text to speech\) - -@status current Introduced in 2.0.0 - -## Parameters - -* `value` \(number\) number to play. Value is interpreted as integer. -* `unit` \(number\) unit identifier \[Full list\]\(\(../appendix/units.html\)\) -* `attributes` \(unsigned number\) possible values: - * `0 or not present` plays integral part of the number \(for a number 123 it plays 123\) - * `PREC1` plays a number with one decimal place \(for a number 123 it plays 12.3\) - * `PREC2` plays a number with two decimal places \(for a number 123 it plays 1.23\) - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playtone.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playtone.md deleted file mode 100644 index 8d611c4a3..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/playtone.md +++ /dev/null @@ -1,21 +0,0 @@ -# playTone\(frequency, duration, pause \[, flags \[, freqIncr\]\]\) - -Play a tone - -@status current Introduced in 2.1.0 - -## Parameters - -* `frequency` \(number\) tone frequency in Hz \(from 150 to 15000\) -* `duration` \(number\) length of the tone in milliseconds -* `pause` \(number\) length of the silence after the tone in milliseconds -* `flags` \(number\): - * `0 or not present` play with normal priority. - * `PLAY_BACKGROUND` play in background \(built in vario function uses this context\) - * `PLAY_NOW` play immediately -* `freqIncr` \(number\) positive number increases the tone pitch \(frequency with time\), negative number decreases it. The frequency changes every 10 milliseconds, the change is `freqIncr * 10Hz`. The valid range is from -127 to 127. - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupconfirmation-title-message-event.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupconfirmation-title-message-event.md deleted file mode 100644 index 9ab3ef8bb..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupconfirmation-title-message-event.md +++ /dev/null @@ -1,20 +0,0 @@ -# popupConfirmation\(title, message, event\) - -Raises a pop-up on screen that asks for confirmation - -@status current Introduced in 2.2.0, changed from \(title, event\) to \(title, message, event\) in 2.3.8 - -## Parameters - -* `title` \(string\) title to display -* `message` \(string\) text to display -* `event` \(number\) the event variable that is passed in from the Run function \(key pressed\) - -## Return value - -* `"CANCEL"` user pushed EXIT key - -### Notice - -Use only from stand-alone and telemetry scripts. - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupconfirmation.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupconfirmation.md deleted file mode 100644 index 9ab3ef8bb..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupconfirmation.md +++ /dev/null @@ -1,20 +0,0 @@ -# popupConfirmation\(title, message, event\) - -Raises a pop-up on screen that asks for confirmation - -@status current Introduced in 2.2.0, changed from \(title, event\) to \(title, message, event\) in 2.3.8 - -## Parameters - -* `title` \(string\) title to display -* `message` \(string\) text to display -* `event` \(number\) the event variable that is passed in from the Run function \(key pressed\) - -## Return value - -* `"CANCEL"` user pushed EXIT key - -### Notice - -Use only from stand-alone and telemetry scripts. - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupinput.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupinput.md deleted file mode 100644 index f0de646be..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupinput.md +++ /dev/null @@ -1,24 +0,0 @@ -# popupInput\(title, event, input, min, max\) - -Raises a pop-up on screen that allows uses input - -@status current Introduced in 2.0.0 - -## Parameters - -* `title` \(string\) text to display -* `event` \(number\) the event variable that is passed in from the Run function \(key pressed\) -* `input` \(number\) value that can be adjusted by the +/­- keys -* `min` \(number\) min value that input can reach \(by pressing the -­ key\) -* `max` \(number\) max value that input can reach - -## Return value - -* `number` result of the input adjustment -* `"OK"` user pushed ENT key -* `"CANCEL"` user pushed EXIT key - -### Notice - -Use only from stand-alone and telemetry scripts. - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupwarning.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupwarning.md deleted file mode 100644 index 8b8860248..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/popupwarning.md +++ /dev/null @@ -1,19 +0,0 @@ -# popupWarning\(title, event\) - -Raises a pop-up on screen that shows a warning - -@status current Introduced in 2.2.0 - -## Parameters - -* `title` \(string\) text to display -* `event` \(number\) the event variable that is passed in from the Run function \(key pressed\) - -## Return value - -* `"CANCEL"` user pushed EXIT key - -### Notice - -Use only from stand-alone and telemetry scripts. - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/resetglobaltimer.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/resetglobaltimer.md deleted file mode 100644 index ebc6802fc..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/resetglobaltimer.md +++ /dev/null @@ -1,20 +0,0 @@ -# resetGlobalTimer\(\[type\]\) - -Resets the radio global timer to 0. - -@status current Introduced in 2.2.2, param added in 2.3 - -## Parameters - -* `(optional)` : if set to 'all', throttle ,throttle percent and session timers are reset too - - ```text - if set to 'session', radio session timer is reset too - if set to 'ttimer', radio throttle timer is reset too - if set to 'tptimer', radio throttle percent timer is reset too - ``` - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialgetpower-port_nr.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialgetpower-port_nr.md deleted file mode 100644 index 8745856c2..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialgetpower-port_nr.md +++ /dev/null @@ -1,14 +0,0 @@ -# serialGetPower(port\_nr) - -@status current Introduced in 2.9.0 - -### Parameters - -* `port_nr:` valid values are only 0 and 1 on radios that have SWSERIALPOWER defined - * 0 - first serial port, e.g. on TX16S AUX1 - * 1 - second serial port, e.g. on TX16S AUX2 - -### Return value - -* `value:` true for power enabled, false for power disabled. -* `nil` serial port power control not available diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialread.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialread.md deleted file mode 100644 index 49b30da95..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialread.md +++ /dev/null @@ -1,16 +0,0 @@ -# serialRead\(\[num\]\) - -@param num \(optional\): maximum number of bytes to read. If non-zero, serialRead will read up to num characters from the buffer. If 0 or left out, serialRead will read up to and including the first newline character or the end of the buffer. Note that the returned string may not end in a newline if this character is not present in the buffer. - -Reads characters from the serial port. The string is allowed to contain any character, including 0. - -@status current Introduced in 2.3.8 - -## Parameters - -none - -## Return value - -* `str` string. Empty if no new characters were available. - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialsetpower-port_nr-value.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialsetpower-port_nr-value.md deleted file mode 100644 index 6af712a3d..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialsetpower-port_nr-value.md +++ /dev/null @@ -1,16 +0,0 @@ -# serialSetPower(port\_nr, value) - -@status current Introduced in 2.9.0 - -### Parameters - -* `port_nr:` valid values are only 0 and 1 on radios that have SWSERIALPOWER defined - * 0 - first serial port, e.g. on TX16S AUX1 - * 1 - second serial port, e.g. on TX16S AUX2 -* `value:` - * 0 - disable power - * 1 - enable power - -### Return value - -* `success:` true/false diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialwrite.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialwrite.md deleted file mode 100644 index 134105022..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/serialwrite.md +++ /dev/null @@ -1,16 +0,0 @@ -# serialWrite\(str\) - -@param str \(string\) String to be written to the serial port. - -Writes a string to the serial port. The string is allowed to contain any character, including 0. - -@status current Introduced in 2.3.10 - -## Parameters - -none - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setserialbaudrate-baudrate.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setserialbaudrate-baudrate.md deleted file mode 100644 index 4f0835542..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setserialbaudrate-baudrate.md +++ /dev/null @@ -1,14 +0,0 @@ -# setSerialBaudrate\(baudrate\) - -Set baudrate for serial port\(s\) affected to LUA - -@status current Introduced in 2.3.12 - -## Parameters - -`baudrate` Desired baudrate - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setserialbaudrate.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setserialbaudrate.md deleted file mode 100644 index 4f0835542..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setserialbaudrate.md +++ /dev/null @@ -1,14 +0,0 @@ -# setSerialBaudrate\(baudrate\) - -Set baudrate for serial port\(s\) affected to LUA - -@status current Introduced in 2.3.12 - -## Parameters - -`baudrate` Desired baudrate - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setshmvar-id-value.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setshmvar-id-value.md deleted file mode 100644 index ccc19608a..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setshmvar-id-value.md +++ /dev/null @@ -1,18 +0,0 @@ -# setShmVar(id, value) - -Sets the value of a shared memory variable that can be used for passing data between Lua widgets and other Lua scripts. - -@status current Introduced in 2.6 - -**Parameters** - -* `id:` integer between 1 and 16 identifying the shared memory variable. -* `value:` integer. The value of the shared memory variable. - -**Return value** - -none - -**Notice** - -Only available on radios with color display diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setstickyswitch-id-value.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setstickyswitch-id-value.md deleted file mode 100644 index 36d43fa68..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/setstickyswitch-id-value.md +++ /dev/null @@ -1,15 +0,0 @@ -# setStickySwitch(id, value) - -Sets the value of a sticky logical switch. - -@status current Introduced in 2.6 - -## Parameters - -* id: integer identifying the sticky logical switch (zero for LS1 etc.). -* value: true/false. The new value of the sticky logical switch. - -## Return value - -* bufferFull: true/false. This function sends a message from Lua to the logical switch processor via a buffer with eight slots that are read 10 times per second. If the buffer is full, then a true value is returned, and no message was sent (i.e. the switch was not changed). - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/settelemetryvalue.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/settelemetryvalue.md deleted file mode 100644 index 36c99f27e..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/settelemetryvalue.md +++ /dev/null @@ -1,25 +0,0 @@ -# setTelemetryValue(id, subID, instance, value \[, unit \[, precision \[, name]]]) - -@status current Introduced in 2.2.0 - -## Parameters - -* `id` Id of the sensor, valid range is from 0 to 0xFFFF -* `subID` subID of the sensor, usually 0, valid range is from 0 to 7 -* `instance` instance of the sensor (SensorID), valid range is from 0 to 0xFF -* `value` fed to the sensor -* `unit` unit of the sensor [Full list](https://luadoc.edgetx.org/appendix/units.html) -* `precision` the precision of the sensor - * `0 or not present` no decimal precision. - * `!= 0` value is divided by 10^precision, e.g. value=1000, prec=2 => 10.00. -* `name` (string) Name of the sensor if it does not yet exist (4 chars). - * `not present` Name defaults to the Id. - * `present` Sensor takes name of the argument. Argument must have name surrounded by quotes: e.g., "Name" - -## Return value - -* `true,` if the sensor was just added. In this case the value is ignored (subsequent call will set the value) - -### Notice - -All three parameters `id`, `subID` and `instance` can't be zero at the same time. At least one of them must be different from zero. diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/sources-first-last.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/sources-first-last.md deleted file mode 100644 index 13ed1e93c..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/sources-first-last.md +++ /dev/null @@ -1,16 +0,0 @@ -# sources(\[first\[, last]]) - -This is an iterator function over value sources. - -`for sourceIndex, sourceName in sources() do ...` - -will iterate over all available value sources. - -### Parameters - -* `first`: the first source index. If `nil` or omitted, the first available source is used. -* `last`: the last soure index. If `nil` or omitted, the last available source is used. - -### Status - -current Introduced in 2.6 diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/sporttelemetrypop.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/sporttelemetrypop.md deleted file mode 100644 index a112e66cb..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/sporttelemetrypop.md +++ /dev/null @@ -1,19 +0,0 @@ -# sportTelemetryPop\(\) - -Pops a received SPORT packet from the queue. Please note that only packets using a data ID within 0x5000 to 0x50FF \(frame ID == 0x10\), as well as packets with a frame ID equal 0x32 \(regardless of the data ID\) will be passed to the LUA telemetry receive queue. - -@status current Introduced in 2.2.0 - -## Parameters - -none - -## Return value - -* `nil` queue does not contain any \(or enough\) bytes to form a whole packet -* `multiple` returns 4 values: - * sensor ID \(number\) - * frame ID \(number\) - * data ID \(number\) - * value \(number\) - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/sporttelemetrypush.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/sporttelemetrypush.md deleted file mode 100644 index 07c718a17..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/sporttelemetrypush.md +++ /dev/null @@ -1,20 +0,0 @@ -# sportTelemetryPush\(\) - -This functions allows for sending SPORT telemetry data toward the receiver, and more generally, to anything connected SPORT bus on the receiver or transmitter. - -When called without parameters, it will only return the status of the output buffer without sending anything. - -@status current Introduced in 2.2.0, retval nil added in 2.3.4 - -## Parameters - -* `sensorId` physical sensor ID -* `frameId` frame ID -* `dataId` data ID -* `value` value - -## Return value - -* `boolean` data queued in output buffer or not. -* `nil` incorrect telemetry protocol. - diff --git a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/switches-first-last.md b/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/switches-first-last.md deleted file mode 100644 index 43c408584..000000000 --- a/part_iii_-_opentx_lua_api_reference/general-functions-less-than-greater-than-luadoc-begin-general/switches-first-last.md +++ /dev/null @@ -1,16 +0,0 @@ -# switches(\[first\[, last]]) - -This is an iterator function over switch positions. - -`for switchIndex, switchName in switches() do ...` - -will iterate over all available switch positions. - -### Parameters - -* `first`: the first switch index. If `nil` or omitted, the first available switch is used. -* `last`: the last switch index. If `nil` or omitted, the last available switch is used. - -### Status - -Current Introduced in 2.6 diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/README.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/README.md deleted file mode 100644 index 7dcb769ba..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Lcd Functions - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/clear.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/clear.md deleted file mode 100644 index 8841c70f4..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/clear.md +++ /dev/null @@ -1,14 +0,0 @@ -# lcd.clear\(\[color\]\) - -Clear the LCD screen - -@status current Introduced in 2.0.0, `color` parameter introduced in 2.2.0 RC12 - -## Parameters - -* `color` \(optional, only on color screens\) - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawannulus.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawannulus.md deleted file mode 100644 index 2e50483fe..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawannulus.md +++ /dev/null @@ -1,17 +0,0 @@ -# lcd.drawAnnulus\(x, y, r1, r2, start, end \[, flags\]\) - -Draw an arc - -@status current Introduced in 2.4.0 - -## Parameters - -* `x,y` \(positive numbers\) coordinates of the center -* `r1,r2` \(positive numbers\) radii of the inside and outside of the annulus -* `start,end` \(positive numbers\) start and end of the annulus -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawarc.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawarc.md deleted file mode 100644 index 95399131e..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawarc.md +++ /dev/null @@ -1,17 +0,0 @@ -# lcd.drawArc\(x, y, r, start, end \[, flags\]\) - -Draw an arc - -@status current Introduced in 2.4.0 - -## Parameters - -* `x,y` \(positive numbers\) coordinates of the center -* `r` \(positive number\) radius -* `start,end` \(positive numbers\) start and end of the arc -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawbitmap.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawbitmap.md deleted file mode 100644 index db7ca35fd..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawbitmap.md +++ /dev/null @@ -1,20 +0,0 @@ -# lcd.drawBitmap\(bitmap, x, y \[, scale\]\) - -Displays a bitmap at \(x,y\) - -@status current Introduced in 2.2.0 - -## Parameters - -* `bitmap` \(pointer\) point to a bitmap previously opened with Bitmap.open\(\) -* `x,y` \(positive numbers\) starting coordinates -* `scale` \(positive numbers\) scale in %, 50 divides size by two, 100 is unchanged, 200 doubles size. Omitting scale draws image in 1:1 scale and is faster than specifying 100 for scale. - -## Return value - -none - -### Notice - -Only available on Horus - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawchannel.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawchannel.md deleted file mode 100644 index e155eb5ee..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawchannel.md +++ /dev/null @@ -1,16 +0,0 @@ -# lcd.drawChannel\(x, y, source, flags\) - -Display a telemetry value at \(x,y\) - -@status current Introduced in 2.0.6, changed in 2.1.0 \(only telemetry sources are valid\) - -## Parameters - -* `x,y` \(positive numbers\) starting coordinate -* `source` can be a source identifier \(number\) or a source name \(string\). See getValue\(\) -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawcircle.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawcircle.md deleted file mode 100644 index ab24dc68e..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawcircle.md +++ /dev/null @@ -1,16 +0,0 @@ -# lcd.drawCircle\(x, y, r \[, flags\]\) - -Draw a circle at \(x, y\) of specified radius - -@status current Introduced in 2.4.0 - -## Parameters - -* `x,y` \(positive numbers\) center position -* `r` \(number\) radius in pixels -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawcombobox.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawcombobox.md deleted file mode 100644 index faf2a88f0..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawcombobox.md +++ /dev/null @@ -1,25 +0,0 @@ -# lcd.drawCombobox\(x, y, w, list, idx \[, flags\]\) - -Draw a combo box - -@status current Introduced in 2.0.0 - -## Parameters - -* `x,y` \(positive numbers\) top left corner position -* `w` \(number\) width of combo box in pixels -* `list` \(table\) combo box elements, each element is a string -* `idx` \(integer\) index of entry to highlight -* `flags` \(unsigned number\) drawing flags, the flags can not be combined: - * `BLINK` combo box is expanded - * `INVERS` combo box collapsed, text inversed - * `0 or not present` combo box collapsed, text normal - -## Return value - -none - -### Notice - -Only available on Taranis - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawfilledcircle.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawfilledcircle.md deleted file mode 100644 index 7eb094bab..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawfilledcircle.md +++ /dev/null @@ -1,16 +0,0 @@ -# lcd.drawFilledCircle\(x, y, r \[, flags\]\) - -Draw a filled circle at \(x, y\) of specified radius - -@status current Introduced in 2.4.0 - -## Parameters - -* `x,y` \(positive numbers\) center position -* `r` \(number\) radius in pixels -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawfilledrectangle.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawfilledrectangle.md deleted file mode 100644 index 041040a5f..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawfilledrectangle.md +++ /dev/null @@ -1,18 +0,0 @@ -# lcd.drawFilledRectangle\(x, y, w, h \[, flags\]\) - -Draw a solid rectangle from top left corner \(x,y\) of specified width and height - -@status current Introduced in 2.0.0 - -## Parameters - -* `x,y` \(positive numbers\) top left corner position -* `w` \(number\) width in pixels -* `h` \(number\) height in pixels -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants -* `opacity` \(number\) opacity defaults to 0 \(only on Horus\) - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawfilledtriangle.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawfilledtriangle.md deleted file mode 100644 index 2fe02ed65..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawfilledtriangle.md +++ /dev/null @@ -1,15 +0,0 @@ -# lcd.drawFilledTriangle\(x1, y1, x2, y2, x3, y3 \[, flags\]\) - -Draw a filled triangle - -@status current Introduced in 2.4.0 - -## Parameters - -* `x1,y1,x2,y2,x3,y3` \(positive numbers\) coordinates of the three vertices -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawgauge.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawgauge.md deleted file mode 100644 index 303cddbe4..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawgauge.md +++ /dev/null @@ -1,19 +0,0 @@ -# lcd.drawGauge\(x, y, w, h, fill, maxfill \[, flags\]\) - -Draw a simple gauge that is filled based upon fill value - -@status current Introduced in 2.0.0, changed in 2.2.0 - -## Parameters - -* `x,y` \(positive numbers\) top left corner position -* `w` \(number\) width in pixels -* `h` \(number\) height in pixels -* `fill` \(number\) amount of fill to apply -* `maxfill` \(number\) total value of fill -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawhudrectangle.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawhudrectangle.md deleted file mode 100644 index 6b70599fb..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawhudrectangle.md +++ /dev/null @@ -1,16 +0,0 @@ -# lcd.drawHudRectangle\(pitch, roll, xmin, xmax, ymin, ymax \[, flags\]\) - -Draw a rectangle in perspective - -@status current Introduced in 2.4.0 - -## Parameters - -* `pitch,roll` \(positive numbers\) pitch and roll to define the orientation of the rectangle -* `xmin,xmax,ymin,ymax` \(positive numbers\) the limits of the rectangle -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawline.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawline.md deleted file mode 100644 index e0585f94d..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawline.md +++ /dev/null @@ -1,21 +0,0 @@ -# lcd.drawLine\(x1, y1, x2, y2, pattern, flags\) - -Draw a straight line on LCD - -@status current Introduced in 2.0.0, flags introduced in 2.3.6 - -## Parameters - -* `x1,y1` \(positive numbers\) starting coordinate -* `x2,y2` \(positive numbers\) end coordinate -* `pattern` SOLID or DOTTED -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -none - -### Notice - -If the start or the end of the line is outside the LCD dimensions, then the whole line will not be drawn \(starting from OpenTX 2.1.5\) - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawlinewithclipping.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawlinewithclipping.md deleted file mode 100644 index daad8cf10..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawlinewithclipping.md +++ /dev/null @@ -1,17 +0,0 @@ -# lcd.drawLineWithClipping\(x1, y1, x2, y2, xmin, xmax, ymin, ymax, pattern \[, flags\]\) - -Draw a line only inside a rectangle - -@status current Introduced in 2.4.0 - -## Parameters - -* `x1,y1,x2,y1` \(positive numbers\) coordinates of the start and end of the unclipped line -* `xmin,xmax,ymin,ymax` \(positive numbers\) the limits of the rectangle inside which the line is drawn -* `pattern` \(FORCE, ERASE, DOTTED\) please see [Lcd functions overview](https://github.com/EdgeTX/lua-reference-guide/tree/2c4596e02006c8ac7d351fcd785fdfc7a93ce548/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd_functions-overview.html) -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawnumber.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawnumber.md deleted file mode 100644 index 4583c6d75..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawnumber.md +++ /dev/null @@ -1,17 +0,0 @@ -# lcd.drawNumber\(x, y, value \[, flags \[, inversColor\]\]\) - -Display a number at \(x,y\) - -@status current Introduced in 2.0.0 - -## Parameters - -* `x,y` \(positive numbers\) starting coordinate -* `value` \(number\) value to display -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants -* `inversColor` \(optional with INVERS flag\) overrides the inverse text color for INVERS - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawpie.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawpie.md deleted file mode 100644 index 2b29efb06..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawpie.md +++ /dev/null @@ -1,17 +0,0 @@ -# lcd.drawPie\(x, y, r, start, end \[, flags\]\) - -Draw a pie slice - -@status current Introduced in 2.4.0 - -## Parameters - -* `x,y` \(positive numbers\) coordinates of the center -* `r` \(positive number\) radius -* `start,end` \(positive numbers\) start and end of the pie slice -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawpixmap.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawpixmap.md deleted file mode 100644 index c46eb2cf2..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawpixmap.md +++ /dev/null @@ -1,19 +0,0 @@ -# lcd.drawPixmap\(x, y, name\) - -Draw a bitmap at \(x,y\) - -@status current Introduced in 2.0.0 - -## Parameters - -* `x,y` \(positive numbers\) starting coordinates -* `name` \(string\) full path to the bitmap on SD card \(i.e. “/IMAGES/test.bmp”\) - -## Return value - -none - -### Notice - -Maximum image size is \[display width / 2\] x \[display height\] pixels. - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawpoint.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawpoint.md deleted file mode 100644 index 2d95aea29..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawpoint.md +++ /dev/null @@ -1,20 +0,0 @@ -# lcd.drawPoint\(x, y\) - -Draw a single pixel at \(x,y\) position - -@status current Introduced in 2.0.0 - -## Parameters - -* `x` \(positive number\) x position -* `y` \(positive number\) y position -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -none - -### Notice - -Taranis has an LCD display width of 212 pixels and height of 64 pixels. Position \(0,0\) is at top left. Y axis is negative, top line is 0, bottom line is 63. Drawing on an existing black pixel produces white pixel \(TODO check this!\) - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawrectangle.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawrectangle.md deleted file mode 100644 index 99271e748..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawrectangle.md +++ /dev/null @@ -1,19 +0,0 @@ -# lcd.drawRectangle\(x, y, w, h \[, flags \[, t\]\]\) - -Draw a rectangle from top left corner \(x,y\) of specified width and height - -@status current Introduced in 2.0.0, changed in 2.2.0 - -## Parameters - -* `x,y` \(positive numbers\) top left corner position -* `w` \(number\) width in pixels -* `h` \(number\) height in pixels -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants -* `t` \(number\) thickness in pixels, defaults to 1 \(only on Horus\) -* `opacity` \(number\) opacity defaults to 0 \(only on Horus\) - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawscreentitle.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawscreentitle.md deleted file mode 100644 index 087eccb58..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawscreentitle.md +++ /dev/null @@ -1,20 +0,0 @@ -# lcd.drawScreenTitle\(title, page, pages\) - -Draw a title bar - -@status current Introduced in 2.0.0 - -## Parameters - -* `title` \(string\) text for the title -* `page` \(number\) page number -* `pages` \(number\) total number of pages. Only used as indicator on the right side of title bar. \(i.e. idx=2, cnt=5, display `2/5`\) - -## Return value - -none - -### Notice - -Only available on Taranis - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawsource.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawsource.md deleted file mode 100644 index a746ad894..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawsource.md +++ /dev/null @@ -1,16 +0,0 @@ -# lcd.drawSource\(x, y, source \[, flags\]\) - -Displays the name of the corresponding input as defined by the source at \(x,y\) - -@status current Introduced in 2.0.0 - -## Parameters - -* `x,y` \(positive numbers\) starting coordinate -* `source` \(number\) source index -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawswitch.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawswitch.md deleted file mode 100644 index b13ec8def..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawswitch.md +++ /dev/null @@ -1,16 +0,0 @@ -# lcd.drawSwitch\(x, y, switch, flags\) - -Draw a text representation of switch at \(x,y\) - -@status current Introduced in 2.0.0 - -## Parameters - -* `x,y` \(positive numbers\) starting coordinate -* `switch` \(number\) number of switch to display, negative number displays negated switch -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) constants, only SMLSIZE, BLINK and INVERS. - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawtext.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawtext.md deleted file mode 100644 index 537c46ff4..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawtext.md +++ /dev/null @@ -1,16 +0,0 @@ -# lcd.drawText(x, y, text \[, flags \[, inversColor]]) - -Draw a text beginning at (x,y) - -@status current Introduced in 2.0.0, `SHADOWED` introduced in 2.2.1 - -## Parameters - -* `x,y` (positive numbers) starting coordinate -* `text` (string) text to display -* `flags` (optional) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants for drawing flags and colors, and [Appendix](../../appendix/fonts.md) for available characters in each font set. -* `inversColor` (optional with the INVERS flag) overrides the inverse text color for INVERS - -## Return value - -none diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawtimer.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawtimer.md deleted file mode 100644 index 8c4b79f8b..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawtimer.md +++ /dev/null @@ -1,17 +0,0 @@ -# lcd.drawTimer\(x, y, value \[, flags \[, inversColor\]\]\) - -Display a value formatted as time at \(x,y\) - -@status current Introduced in 2.0.0 - -## Parameters - -* `x,y` \(positive numbers\) starting coordinate -* `value` \(number\) time in seconds -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants -* `inversColor` \(optional with INVERS flag\) overrides the inverse text color for INVERS - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawtriangle.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawtriangle.md deleted file mode 100644 index 5f4b6e6e4..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/drawtriangle.md +++ /dev/null @@ -1,15 +0,0 @@ -# lcd.drawTriangle\(x1, y1, x2, y2, x3, y3 \[, flags\]\) - -Draw a triangle - -@status current Introduced in 2.4.0 - -## Parameters - -* `x1,y1,x2,y2,x3,y3` \(positive numbers\) coordinates of the three vertices -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getcolor.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getcolor.md deleted file mode 100644 index 42870a17d..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getcolor.md +++ /dev/null @@ -1,18 +0,0 @@ -# lcd.getColor\(flags\) - -Get the color value from flags - -@status current Introduced in 2.3.11 - -## Parameters - -* `flags` \(flags\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -* `color` \(flag\) only the RGB565 color value of the input - -### Notice - -Only available on radios with color display - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getlastleftpos.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getlastleftpos.md deleted file mode 100644 index 6db6f0989..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getlastleftpos.md +++ /dev/null @@ -1,18 +0,0 @@ -# lcd.getLastLeftPos\(\) - -Returns the leftmost x position from previous drawtext or drawNumber output - -@status current Introduced in 2.2.0 - -## Parameters - -none - -## Return value - -* `number` \(integer\) x position - -### Notice - -Only available on Taranis - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getlastpos.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getlastpos.md deleted file mode 100644 index 2ade6a6ee..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getlastpos.md +++ /dev/null @@ -1,20 +0,0 @@ -# lcd.getLastPos\(\) - -Returns the rightmost x position from previous output - -@status current Introduced in 2.0.0 - -## Parameters - -none - -## Return value - -* `number` \(integer\) x position - -### Notice - -Only available on Taranis - -For added clarity, it is recommended to use lcd.getLastRightPos\(\) - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getlastrightpos.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getlastrightpos.md deleted file mode 100644 index 7ee37c2b4..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/getlastrightpos.md +++ /dev/null @@ -1,20 +0,0 @@ -# lcd.getLastRightPos\(\) - -Returns the rightest x position from previous drawtext or drawNumber output - -@status current Introduced in 2.2.0 - -## Parameters - -none - -## Return value - -* `number` \(integer\) x position - -### Notice - -Only available on Taranis - -This is strictly equivalent to former lcd.getLastPos\(\) - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.drawbitmappattern-bitmap-x-y-flags.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.drawbitmappattern-bitmap-x-y-flags.md deleted file mode 100644 index 4521c37ce..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.drawbitmappattern-bitmap-x-y-flags.md +++ /dev/null @@ -1,19 +0,0 @@ -# lcd.drawBitmapPattern(bitmap, x, y \[, flags]) - -Displays a bitmap pattern at (x,y) - -@status current Introduced in 2.8.0 - -**Parameters** - -* `bitmap` (pointer) point to a bitmap previously opened with Bitmap.open() -* `x,y` (positive numbers) starting coordinates -* `flags` (optional) please see Lcd functions overview - -**Return value** - -none - -**Notice** - -Only available on Horus diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.drawbitmappatternpie-bitmap-x-y-startangle-endangle-flags.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.drawbitmappatternpie-bitmap-x-y-startangle-endangle-flags.md deleted file mode 100644 index ef9fcc396..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.drawbitmappatternpie-bitmap-x-y-startangle-endangle-flags.md +++ /dev/null @@ -1,21 +0,0 @@ -# lcd.drawBitmapPatternPie(bitmap, x, y, startAngle, endAngle \[, flags]) - -Displays a bitmap pattern pie at (x,y) - -@status current Introduced in 2.8.0 - -**Parameters** - -* `bitmap` (pointer) point to a bitmap previously opened with Bitmap.open() -* `x,y` (positive numbers) starting coordinates -* `startAngle` Start angle -* `endAngle` End angle -* `flags` (optional) please see Lcd functions overview - -**Return value** - -none - -**Notice** - -Only available on Horus diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.drawtextlines-x-y-w-h-text-flags.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.drawtextlines-x-y-w-h-text-flags.md deleted file mode 100644 index 90598b8a3..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.drawtextlines-x-y-w-h-text-flags.md +++ /dev/null @@ -1,20 +0,0 @@ -# lcd.drawTextLines(x, y, w, h, text \[, flags]) - -Draw text inside rectangle (x,y,w,h) with line breaks - -@status current Introduced in 2.5.0 - -## Parameters - -* `x,y` (positive numbers) starting coordinate -* `w,h` (positive numbers) width and height of bounding rectangle -* `text` (string) text to display -* `flags` (optional) please see [Lcd functions overview](lcd\_functions-overview.html) for drawing flags and colors, and [Appendix](../../appendix/fonts.md) for available characters in each font set. RIGHT, CENTER and VCENTER are not implemented. - -## Return value - -none - -## Notes - -* Color radios only. diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.exitfullscreen.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.exitfullscreen.md deleted file mode 100644 index 0b4343f2d..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.exitfullscreen.md +++ /dev/null @@ -1,10 +0,0 @@ -# lcd.exitFullScreen\(\) - -Exit full screen widget mode. - -@status current Introduced in 2.5.0 - -### Notice - -Only available on radios with color display - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.invertrect-x-y-w-h-flags.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.invertrect-x-y-w-h-flags.md deleted file mode 100644 index 3b0ee5ef5..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd.invertrect-x-y-w-h-flags.md +++ /dev/null @@ -1,16 +0,0 @@ -# lcd.invertRect(x, y, w, h \[, flags]) - -Invert a rectangle zone from top left corner (x,y) of specified width and height - -@status current Introduced in 2.8.0 - -**Parameters** - -* `x,y` (positive numbers) top left corner position -* `w` (number) width in pixels -* `h` (number) height in pixels -* `flags` (optional) please see Lcd functions overview - -**Return value** - -none diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd_functions-overview.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd_functions-overview.md deleted file mode 100644 index a4445798e..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/lcd_functions-overview.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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](../constants/flags-and-pattern-constants.md), [colors](../constants/color-constants.md), and [screen size](../constants/screen-constants.md) that can be used with lcd drawing functions. - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/refresh.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/refresh.md deleted file mode 100644 index 755afe1df..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/refresh.md +++ /dev/null @@ -1,16 +0,0 @@ -# lcd.refresh\(\) - -Refresh the LCD screen - -From 2.4.0 on color LCDs, this is done automatically when the screen needs to be refreshed \(on events and depending on refresh period\). - -@status current Only used on non-color LCDs. - -## Parameters - -none - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/resetbacklighttimeout.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/resetbacklighttimeout.md deleted file mode 100644 index abe2000ed..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/resetbacklighttimeout.md +++ /dev/null @@ -1,14 +0,0 @@ -# lcd.resetBacklightTimeout\(\) - -Reset the backlight timeout - -@status current Introduced in 2.3.6 - -## Parameters - -none - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/rgb.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/rgb.md deleted file mode 100644 index 0eb757b1e..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/rgb.md +++ /dev/null @@ -1,21 +0,0 @@ -# lcd.RGB\(r, g, b \| rgb\) - -Returns a drawing flag with RGB color code - -@status current Introduced in 2.2.0 - -## Parameters - -* `r` \(integer\) a number between 0 and 255 that expresses the amount of red in the color -* `g` \(integer\) a number between 0 and 255 that expresses the amount of green in the color -* `b` \(integer\) a number between 0 and 255 that expresses the amount of blue in the color -* `rgb` \(integer\) a number between 0 and 0xFFFFFF that expresses the RGB value \(0xFF0000=RED, 0x00FF00=GREEN, 0x0000FF=BLUE\) - -## Return value - -* `flag` with RGB565 color - -### Notice - -Only available on radios with color display. Use _either_ lcd.RGB\(r,g,b\) _or_ lcd.RGB\(rgb\). - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/setcolor.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/setcolor.md deleted file mode 100644 index 4772e72b0..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/setcolor.md +++ /dev/null @@ -1,24 +0,0 @@ -# lcd.setColor\(colorIndex, color\) - -Change an indexed color \(theme colors and CUSTOM\_COLOR\). - -@status current Introduced in 2.2.0 - -## Notice - -* Changing theme colors affects not only other Lua widgets, but the entire radio interface. -* Only available on radios with color display - -## Parameters - -* `colorIndex` \(flags\) must be an indexed color, please see [color](../constants/color-constants.md) constants. -* `color` \(flags\) please see [color](../constants/color-constants.md) constants. - -## Return value - -none - -### Notice - -Only available on radios with color display - diff --git a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/sizetext.md b/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/sizetext.md deleted file mode 100644 index 35937fc85..000000000 --- a/part_iii_-_opentx_lua_api_reference/lcd-functions-less-than-greater-than-luadoc-begin-lcd/sizetext.md +++ /dev/null @@ -1,15 +0,0 @@ -# lcd.sizeText\(text \[, flags\]\) - -Get the width and height of a text string drawn with flags - -@status current Introduced in 2.5.0 - -## Parameters - -* `text` \(string\) -* `flags` \(optional\) please see [flags](../constants/flags-and-pattern-constants.md) and [color](../constants/color-constants.md) constants - -## Return value - -* `w,h` \(integers\) width and height of the text - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/README.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/README.md deleted file mode 100644 index d92fe826b..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Model Functions - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/defaultinputs.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/defaultinputs.md deleted file mode 100644 index 6664a1e7e..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/defaultinputs.md +++ /dev/null @@ -1,14 +0,0 @@ -# model.defaultInputs\(\) - -Set all inputs to defaults - -@status current Introduced in 2.0.0 - -## Parameters - -none - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deleteflightmodes.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deleteflightmodes.md deleted file mode 100644 index d5fa704cb..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deleteflightmodes.md +++ /dev/null @@ -1,14 +0,0 @@ -# model.deleteFlightModes\(\) - -Clear all flightModes - -@status current Introduced in 2.3.10 - -## Parameters - -none - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deleteinput.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deleteinput.md deleted file mode 100644 index 9a0465148..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deleteinput.md +++ /dev/null @@ -1,15 +0,0 @@ -# model.deleteInput\(input, line\) - -Delete line from specified input - -@status current Introduced in 2.0.0 - -## Parameters - -* `input` \(unsigned number\) input number \(use 0 for Input1\) -* `line` \(unsigned number\) input line \(use 0 for first line\) - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deleteinputs.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deleteinputs.md deleted file mode 100644 index 4790e714c..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deleteinputs.md +++ /dev/null @@ -1,14 +0,0 @@ -# model.deleteInputs\(\) - -Delete all Inputs - -@status current Introduced in 2.0.0 - -## Parameters - -none - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deletemix.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deletemix.md deleted file mode 100644 index 8e5225ae6..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deletemix.md +++ /dev/null @@ -1,15 +0,0 @@ -# model.deleteMix\(channel, line\) - -Delete mixer line from specified Channel - -@status current Introduced in 2.0.0 - -## Parameters - -* `channel` \(unsigned number\) channel number \(use 0 for CH1\) -* `line` \(unsigned number\) mix number \(use 0 for first line\(mix\)\) - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deletemixes.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deletemixes.md deleted file mode 100644 index bb854c832..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/deletemixes.md +++ /dev/null @@ -1,14 +0,0 @@ -# model.deleteMixes\(\) - -Remove all mixers - -@status current Introduced in 2.0.0 - -## Parameters - -none - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getcurve.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getcurve.md deleted file mode 100644 index 425bf5f9e..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getcurve.md +++ /dev/null @@ -1,26 +0,0 @@ -# model.getCurve(curve) - -Get Curve parameters - -Note this function uses Lua's usual index starting with 1 since version 2.9.0. - -@status current Introduced in 2.0.12, uses Lua's normal indexing as of 2.9.0 - -## Parameters - -* `curve` (unsigned number) curve number (use 0 for Curve1) - -## Return value - -* `nil` requested curve does not exist -* `table` curve data: - * `name` (string) name - * `type` (number) type - * `smooth` (boolean) smooth - * `points` (number) number of points - * `y` (table) table of Y values: - * `key` is point number (zero based) - * `value` is y value - * `x` (table) **only included for custom curve type**: - * `key` is point number (zero based) - * `value` is x value diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getcustomfunction.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getcustomfunction.md deleted file mode 100644 index e6bda79b3..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getcustomfunction.md +++ /dev/null @@ -1,22 +0,0 @@ -# model.getCustomFunction\(function\) - -Get Custom Function parameters - -@status current Introduced in 2.0.0, TODO rename function - -## Parameters - -* `function` \(unsigned number\) custom function number \(use 0 for CF1\) - -## Return value - -* `nil` requested custom function does not exist -* `table` custom function data: - * `switch` \(number\) switch index - * `func` \(number\) function index - * `name` \(string\) Name of track to play \(only returned only returned if action is play track, sound or script\) - * `value` \(number\) value \(only returned only returned if action is **not** play track, sound or script\) - * `mode` \(number\) mode \(only returned only returned if action is **not** play track, sound or script\) - * `param` \(number\) parameter \(only returned only returned if action is **not** play track, sound or script\) - * `active` \(number\) 0 = disabled, 1 = enabled - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getflightmode.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getflightmode.md deleted file mode 100644 index b8c77c014..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getflightmode.md +++ /dev/null @@ -1,25 +0,0 @@ -# model.getFlightMode\(index\) - -Return input data for given input and line number - -@status current Introduced in 2.3.10 - -## Parameters - -* `index` \(unsigned number\) flight mode number \(use 0 for FM0\) - -## Return value - -* `nil` requested input or line does not exist -* `table` input data: - * `name` \(string\) input line name - * `switch` \(number\) input switch index - * `fadeIn` \(number\) fade in value \(in 0.1s\) - * `fadeOut` \(number\) fade out value \(in 0.1s\) - * `trimsValues` \(table\) table of trim values: - * `key` is trim number \(zero based\) - * `value` is trim value - * `trimsModes` \(table\) table of trim mode: - * `key` is trim number \(zero based\) - * `value` is trim mode - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getglobalvariable.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getglobalvariable.md deleted file mode 100644 index 5f77a525c..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getglobalvariable.md +++ /dev/null @@ -1,25 +0,0 @@ -# model.getGlobalVariable\(index, flight\_mode\) - -Return current global variable value - -Example: - -```lua - -- get GV3 (index = 2) from Flight mode 0 (FM0) - val = model.getGlobalVariable(2, 0) -``` - -## Parameters - -* `index` zero based global variable index, use 0 for GV1, 8 for GV9 -* `flight_mode` Flight mode number \(0 = FM0, 8 = FM8\) - -## Return value - -* `nil` requested global variable does not exist -* `number` current value of global variable - -### Notice - -a simple warning or notice - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getinfo.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getinfo.md deleted file mode 100644 index c86f1de58..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getinfo.md +++ /dev/null @@ -1,18 +0,0 @@ -# model.getInfo() - -Get current Model information - -@status current Introduced in 2.0.6, changed in 2.2.0, filename added in 2.6.0, extendedLimits, jitterFilter, and labels added in 2.8.0 - -## Parameters - -none - -## Return value - -* `table` model information: - * `name` (string) model name - * `extendedLimits` (boolean) extended limits enabled - * `jitterFilter` (number) model level ADC filter - * `bitmap` (string) bitmap name (not present on X7) - * `filename` (string) model filename diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getinput.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getinput.md deleted file mode 100644 index 48b6070fa..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getinput.md +++ /dev/null @@ -1,26 +0,0 @@ -# model.getInput\(input, line\) - -Return input data for given input and line number - -@status current Introduced in 2.0.0, curveType/curveValue/carryTrim added in 2.3, inputName added 2.3.10, flighmode reworked in 2.3.11 - -## Parameters - -* `input` \(unsigned number\) input number \(use 0 for Input1\) -* `line` \(unsigned number\) input line \(use 0 for first line\) - -## Return value - -* `nil` requested input or line does not exist -* `table` input data: - * `name` \(string\) input line name - * `inputName` \(string\) input input name - * `source` \(number\) input source index - * `weight` \(number\) input weight - * `offset` \(number\) input offset - * `switch` \(number\) input switch index - * `curveType` \(number\) curve type \(function, expo, custom curve\) - * `curveValue` \(number\) curve index - * `carryTrim` \(boolean\) input trims applied - * 'flightModes' \(number\) bit-mask of active flight modes - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getinputscount.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getinputscount.md deleted file mode 100644 index 0b693e427..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getinputscount.md +++ /dev/null @@ -1,14 +0,0 @@ -# model.getInputsCount\(input\) - -Return number of lines for given input - -@status current Introduced in 2.0.0 - -## Parameters - -* `input` \(unsigned number\) input number \(use 0 for Input1\) - -## Return value - -* `number` number of configured lines for given input - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getlogicalswitch.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getlogicalswitch.md deleted file mode 100644 index 00f8928ce..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getlogicalswitch.md +++ /dev/null @@ -1,21 +0,0 @@ -# model.getLogicalSwitch(switch) - -Get Logical Switch parameters - -@status current Introduced in 2.0.0 - -## Parameters - -* `switch` (unsigned number) logical switch number (use 0 for LS1) - -## Return value - -* `nil` requested logical switch does not exist -* `table` logical switch data: - * `func` (number) function index, see [Logical Switch Function Constants](../constants/logical-switch-function-constants.md). - * `v1` (number) V1 value (index) - * `v2` (number) V2 value (index or value) - * `v3` (number) V3 value (index or value) - * `and` (number) AND switch index - * `delay` (number) delay (time in 1/10 s) - * `duration` (number) duration (time in 1/10 s) diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getmix.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getmix.md deleted file mode 100644 index 7a774e9cd..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getmix.md +++ /dev/null @@ -1,31 +0,0 @@ -# model.getMix\(channel, line\) - -Get configuration for specified Mix - -@status current Introduced in 2.0.0, parameters below `multiplex` added in 2.0.13 - -## Parameters - -* `channel` \(unsigned number\) channel number \(use 0 for CH1\) -* `line` \(unsigned number\) mix number \(use 0 for first line\(mix\)\) - -## Return value - -* `nil` requested channel or line does not exist -* `table` mix data: - * `name` \(string\) mix line name - * `source` \(number\) source index - * `weight` \(number\) weight \(1024 == 100%\) value or GVAR1..9 = 4096..4011, -GVAR1..9 = 4095..4087 - * `offset` \(number\) offset value or GVAR1..9 = 4096..4011, -GVAR1..9 = 4095..4087 - * `switch` \(number\) switch index - * `multiplex` \(number\) multiplex \(0 = ADD, 1 = MULTIPLY, 2 = REPLACE\) - * `curveType` \(number\) curve type \(function, expo, custom curve\) - * `curveValue` \(number\) curve index - * `flightModes` \(number\) bit-mask of active flight modes - * `carryTrim` \(boolean\) carry trim - * `mixWarn` \(number\) warning \(0 = off, 1 = 1 beep, .. 3 = 3 beeps\) - * `delayUp` \(number\) delay up \(time in 1/10 s\) - * `delayDown` \(number\) delay down - * `speedUp` \(number\) speed up - * `speedDown` \(number\) speed down - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getmixescount.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getmixescount.md deleted file mode 100644 index 9a894652f..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getmixescount.md +++ /dev/null @@ -1,14 +0,0 @@ -# model.getMixesCount\(channel\) - -Get the number of Mixer lines that the specified Channel has - -@status current Introduced in 2.0.0 - -## Parameters - -* `channel` \(unsigned number\) channel number \(use 0 for CH1\) - -## Return value - -* `number` number of mixes for requested channel - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getmodule.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getmodule.md deleted file mode 100644 index df8290060..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getmodule.md +++ /dev/null @@ -1,49 +0,0 @@ -# model.getModule\(index\) - -Get RF module parameters - -`Type` values: - -* 0 NONE -* 1 PPM -* 2 XJT\_PXX1 -* 3 ISRM\_PXX2 -* 4 DSM2 -* 5 CROSSFIRE -* 6 MULTIMODULE -* 7 R9M\_PXX1 -* 8 R9M\_PXX2 -* 9 R9M\_LITE\_PXX1 -* 10 R9M\_LITE\_PXX2 -* 11 R9M\_LITE\_PRO\_PXX1 -* 12 R9M\_LITE\_PRO\_PXX2 -* 13 SBUS -* 14 XJT\_LITE\_PXX2 - -`subType` values for XJT\_PXX1: - -* -1 OFF -* 0 D16 -* 1 D8 -* 2 LR12 - -@status current Introduced in 2.2.0 - -## Parameters - -* `index` \(number\) module index \(0 for internal, 1 for external\) - -## Return value - -* `nil` requested module does not exist -* `table` module parameters: - * `subType` \(number\) protocol index - * `modelId` \(number\) receiver number - * `firstChannel` \(number\) start channel \(0 is CH1\) - * `channelsCount` \(number\) number of channels sent to module - * `Type` \(number\) module type - * if the module type is Multi additional information are available - * `protocol` \(number\) protocol number \(Multi only\) - * `subProtocol` \(number\) sub-protocol number \(Multi only\) - * `channelsOrder` \(number\) first 4 channels expected order \(Multi only\) - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getoutput.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getoutput.md deleted file mode 100644 index 72a4c9a8b..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getoutput.md +++ /dev/null @@ -1,25 +0,0 @@ -# model.getOutput\(index\) - -Get servo parameters - -@status current Introduced in 2.0.0 - -## Parameters - -* `index` \(unsigned number\) output number \(use 0 for CH1\) - -## Return value - -* `nil` requested output does not exist -* `table` output parameters: - * `name` \(string\) name - * `min` \(number\) Minimum % \* 10 - * `max` \(number\) Maximum % \* 10 - * `offset` \(number\) Subtrim \* 10 - * `ppmCenter` \(number\) offset from PPM Center. 0 = 1500 - * `symetrical` \(number\) linear Subtrim 0 = Off, 1 = On - * `revert` \(number\) irection 0 = ­­­---, 1 = INV - * `curve` - * \(number\) Curve number \(0 for Curve1\) - * or `nil` if no curve set - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getsensor.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getsensor.md deleted file mode 100644 index fd883b21e..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/getsensor.md +++ /dev/null @@ -1,22 +0,0 @@ -# model.getSensor\(sensor\) - -Get Telemetry Sensor parameters - -@status current Introduced in 2.3.0 - -## Parameters - -* `sensor` \(unsigned number\) sensor number \(use 0 for sensor 1\) - -## Return value - -* `nil` requested sensor does not exist -* `table` with sensor data: - * `type` \(number\) 0 = custom, 1 = calculated - * `name` \(string\) Name - * `unit` \(number\) See list of units in the appendix of the OpenTX Lua Reference Guide - * `prec` \(number\) Number of decimals - * `id` \(number\) Only custom sensors - * `instance` \(number\) Only custom sensors - * `formula` \(number\) Only calculated sensors. 0 = Add etc. see list of formula choices in Companion popup - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/gettimer.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/gettimer.md deleted file mode 100644 index 58cf40299..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/gettimer.md +++ /dev/null @@ -1,22 +0,0 @@ -# model.getTimer\(timer\) - -Get model timer parameters - -@status current Introduced in 2.0.0, name added in 2.3.6 - -## Parameters - -* `timer` \(number\) timer index \(0 for Timer 1\) - -## Return value - -* `nil` requested timer does not exist -* `table` timer parameters: - * `mode` \(number\) timer trigger source: off, abs, stk, stk%, sw/!sw, !m\_sw/!m\_sw - * `start` \(number\) start value \[seconds\], 0 for up timer, 0> down timer - * `value` \(number\) current value \[seconds\] - * `countdownBeep` \(number\) countdown beep \(0­ = silent, 1 =­ beeps, 2­ = voice\) - * `minuteBeep` \(boolean\) minute beep - * `persistent` \(number\) persistent timer - * `name` \(string\) timer name - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/insertinput.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/insertinput.md deleted file mode 100644 index 0f39d66ea..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/insertinput.md +++ /dev/null @@ -1,16 +0,0 @@ -# model.insertInput\(input, line, value\) - -Insert an Input at specified line - -@status current Introduced in 2.0.0, curveType/curveValue/carryTrim added in 2.3, inputName added 2.3.10 - -## Parameters - -* `input` \(unsigned number\) input number \(use 0 for Input1\) -* `line` \(unsigned number\) input line \(use 0 for first line\) -* `value` \(table\) input data, see model.getInput\(\) - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/insertmix.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/insertmix.md deleted file mode 100644 index c9871f641..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/insertmix.md +++ /dev/null @@ -1,16 +0,0 @@ -# model.insertMix\(channel, line, value\) - -Insert a mixer line into Channel - -@status current Introduced in 2.0.0, parameters below `multiplex` added in 2.0.13 - -## Parameters - -* `channel` \(unsigned number\) channel number \(use 0 for CH1\) -* `line` \(unsigned number\) mix number \(use 0 for first line\(mix\)\) -* `value` \(table\) see model.getMix\(\) for table format - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/model.getswashring.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/model.getswashring.md deleted file mode 100644 index ecaeed4cb..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/model.getswashring.md +++ /dev/null @@ -1,21 +0,0 @@ -# model.getSwashRing() - -Get heli swash parameters - -@status current Introduced in 2.8.0 - -**Parameters** - -none - -**Return value** - -* `table` with heli swash parameters: -* `type` (number) 0=---, 1=120, 2=120X, 3=140, 4=90 -* `value` (number) swash ring value (normally 0) -* 'collectiveSource' (number) source index -* 'aileronSource' (number) source index -* 'elevatorSource' (number) source index -* 'collectiveWeight'(value) -100 to 100 -* 'aileronWeight' (value) -100 to 100 -* 'elevatorWeight' (value) -100 to 100 diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/model.setswashring-params.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/model.setswashring-params.md deleted file mode 100644 index 15bf63d3a..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/model.setswashring-params.md +++ /dev/null @@ -1,17 +0,0 @@ -# model.setSwashRing(params) - -Set heli swash parameters - -@status current Introduced in 2.8.0 - -**Parameters** - -* `value` (table) swash ring parameters, see model.getSwashRing() for table format - -**Return value** - -none - -**Notice** - -If a parameter is missing, then that parameter remains unchanged. diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/resetsensor.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/resetsensor.md deleted file mode 100644 index 599d033ea..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/resetsensor.md +++ /dev/null @@ -1,14 +0,0 @@ -# model.resetSensor\(sensor\) - -Reset Telemetry Sensor parameters - -@status current Introduced in 2.3.11 - -## Parameters - -* `sensor` \(unsigned number\) sensor number \(use 0 for sensor 1\) - -## Return value - -* `nil` - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/resettimer.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/resettimer.md deleted file mode 100644 index c2d7c30b9..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/resettimer.md +++ /dev/null @@ -1,14 +0,0 @@ -# model.resetTimer\(timer\) - -Reset model timer to a startup value - -@status current Introduced in TODO - -## Parameters - -* `timer` \(number\) timer index \(0 for Timer 1\) - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setcurve.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setcurve.md deleted file mode 100644 index 8fe36de64..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setcurve.md +++ /dev/null @@ -1,45 +0,0 @@ -# model.setCurve\(curve, params\) - -Set Curve parameters - -The first and last x value must -100 and 100 and x values must be monotonically increasing - -@status current Introduced in 2.2.0 - -Example setting a 4-point custom curve: - -```lua - params = {} - params["x"] = {-100, -34, 77, 100} - params["y"] = {-70, 20, -89, -100} - params["smooth"] = true - params["type"] = 1 - val = model.setCurve(2, params) -``` - -setting a 6-point standard smoothed curve - -```lua - val = model.setCurve(3, {smooth=true, y={-100, -50, 0, 50, 100, 80}}) -``` - -## Parameters - -* `curve` \(unsigned number\) curve number \(use 0 for Curve1\) -* `params` see model.getCurve return format for table format. setCurve uses standard lua array indexing and arrays start at index 1 - -## Return value - -* \`\` 0 - Everything okay - - ```text - 1 - Wrong number of points - 2 - Invalid Curve number - 3 - Cuve does not fit anymore - 4 - point of out of index - 5 - x value not monotonically increasing - 6 - y value not in range [-100;100] - 7 - extra values for y are set - 8 - extra values for x are set - ``` - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setcustomfunction.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setcustomfunction.md deleted file mode 100644 index edabc9d7e..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setcustomfunction.md +++ /dev/null @@ -1,18 +0,0 @@ -# model.setCustomFunction(function, value) - -Set Custom Function parameters - -@status current Introduced in 2.0.0, TODO rename function - -## Parameters - -* `function` (unsigned number) custom function number, see [Special Function Constants](../constants/special-function-constants.md). -* `value` (table) custom function parameters, see model.getCustomFunction() for table format - -## Return value - -none - -### Notice - -If a parameter is missing from the value, then that parameter remains unchanged. diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setflightmode.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setflightmode.md deleted file mode 100644 index 89ee23596..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setflightmode.md +++ /dev/null @@ -1,15 +0,0 @@ -# model.setFlightMode\(index, params\) - -Set Flight mode parameters - -@status current Introduced in 2.3.10 - -## Parameters - -* `index` \(unsigned number\) flight mode number \(use 0 for FM0\) -* `params` see model.getFlightMode return format for table format. - -## Return value - -none - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setglobalvariable.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setglobalvariable.md deleted file mode 100644 index faabd4c62..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setglobalvariable.md +++ /dev/null @@ -1,18 +0,0 @@ -# model.setGlobalVariable\(index, flight\_mode, value\) - -Sets current global variable value. See also model.getGlobalVariable\(\) - -## Parameters - -* `index` zero based global variable index, use 0 for GV1, 8 for GV9 -* `flight_mode` Flight mode number \(0 = FM0, 8 = FM8\) -* `value` new value for global variable. Permitted range is from -1024 to 1024. - -## Return value - -none - -### Notice - -Global variable can only store integer values, any floating point value is converted into integer value by truncating everything behind a floating point. - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setinfo.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setinfo.md deleted file mode 100644 index 8f8440be7..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setinfo.md +++ /dev/null @@ -1,18 +0,0 @@ -# model.setInfo\(value\) - -Set the current Model information - -@status current Introduced in 2.0.6, changed in TODO - -## Parameters - -* `value` model information data, see model.getInfo\(\) - -## Return value - -none - -### Notice - -If a parameter is missing from the value, then that parameter remains unchanged. - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setlogicalswitch.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setlogicalswitch.md deleted file mode 100644 index edbf48dfa..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setlogicalswitch.md +++ /dev/null @@ -1,21 +0,0 @@ -# model.setLogicalSwitch\(switch, value\) - -Set Logical Switch parameters - -@status current Introduced in 2.0.0 - -## Parameters - -* `switch` \(unsigned number\) logical switch number \(use 0 for LS1\) -* `value` \(table\) see model.getLogicalSwitch\(\) for table format - -## Return value - -none - -### Notice - -If a parameter is missing from the value, then that parameter remains unchanged. - -To set the `and` member \(which is Lua keyword\) use the following syntax: `model.setLogicalSwitch(30, {func=4,v1=1,v2=-99, ["and"]=24})` - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setmodule.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setmodule.md deleted file mode 100644 index ba2c81eb5..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setmodule.md +++ /dev/null @@ -1,19 +0,0 @@ -# model.setModule\(index, value\) - -Set RF module parameters - -@status current Introduced in 2.2.0, modified in 2.3.12 \(proto/subproto\) - -## Parameters - -* `index` \(number\) module index \(0 for internal, 1 for external\) -* `value` module parameters, see model.getModule\(\) - -## Return value - -none - -### Notice - -If a parameter is missing from the value, then that parameter remains unchanged. - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setoutput.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setoutput.md deleted file mode 100644 index 5fb0fc60c..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/setoutput.md +++ /dev/null @@ -1,19 +0,0 @@ -# model.setOutput\(index, value\) - -Set servo parameters - -@status current Introduced in 2.0.0 - -## Parameters - -* `index` \(unsigned number\) channel number \(use 0 for CH1\) -* `value` \(table\) servo parameters, see model.getOutput\(\) for table format - -## Return value - -none - -### Notice - -If a parameter is missing from the value, then that parameter remains unchanged. - diff --git a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/settimer.md b/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/settimer.md deleted file mode 100644 index 2bf783203..000000000 --- a/part_iii_-_opentx_lua_api_reference/model-functions-less-than-greater-than-luadoc-begin-model/settimer.md +++ /dev/null @@ -1,19 +0,0 @@ -# model.setTimer\(timer, value\) - -Set model timer parameters - -@status current Introduced in 2.0.0, name added in 2.3.6 - -## Parameters - -* `timer` \(number\) timer index \(0 for Timer 1\) -* `value` timer parameters, see model.getTimer\(\) - -## Return value - -none - -### Notice - -If a parameter is missing from the value, then that parameter remains unchanged. - diff --git a/part_iv_-_advanced_topics/README.md b/part_iv_-_advanced_topics/README.md deleted file mode 100644 index d5127e1d0..000000000 --- a/part_iv_-_advanced_topics/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Part VI - Advanced Topics - -The advanced topics section covers file I/O, data sharing, and debugging techniques - diff --git a/part_iv_-_advanced_topics/debugging_techniques.md b/part_iv_-_advanced_topics/debugging_techniques.md deleted file mode 100644 index fa24be67a..000000000 --- a/part_iv_-_advanced_topics/debugging_techniques.md +++ /dev/null @@ -1,100 +0,0 @@ -# Debugging techniques - -## Debugging your code before testing - -### A good editor is key - -It is always good practice to check your code on syntax before even testing it. There are several good LUA editors on the market, some of them for free. The ZeroBrane \([https://studio.zerobrane.com/](https://studio.zerobrane.com/)\) suite is quite powerful, and very simple to use. In the rest of this article we will assume you use ZeroBrane, but the same techniques can be used in any powerful code editor. - -You can set ZeroBrane to use the Scripts directory of your simulated transmitter SDCard image as a default directory, and it will show you all the files in a nice navigation tree. - -If you open a LUA file, you will already have some markup in your screen, indicating errors or important info. In ZeroBrane for instance, a not declared variable will always get underlined, so that you are made aware you forgot to declare it, or you redeclared it by accident afterwards again. - -### Checking if the code can be compiled - -The editor will have an "execute code" option, that will try to run the code on it's own interpreter \(code processing engine\). If there are any syntax errors, it will not be able to execute the code, and inform you about the errors. A common error in LUA is using a single equal sign \(=\) in a condition in an 'if' statement, whereas in LUA that should be a double equal sign \(==\). The interpreter will inform you about such an error ocurring, and mention the line where you made the error. - -Since the OpenTX LUA environment has some own functions, like lcd.drawText\(\), the interpreter will 'complain' it cannot call an unspecified function, but it will check the entire syntax nonetheless. - -### Ready to run the code - -In zerobrane, if you tried to run the code, it will first save it if it could be interpreted correctly. A common workflow would be: - -* do some code corrections / additions -* try to run the code in the editor -* if the code gets compiled, the edited LUA file gets saved automatically -* run the code in the transmitter simulator -* check for the desired functionality -* restart this cycle - -## The lua debug viewer - -In the later versions of the companion software, a LUA debug screen is available. So once you start your just syntaxically verified and saved LUA script, you can follow some of it's output and actions in the debug screen. It will tell you where and in what line an eventual crash occured. - -## Using a script loader - -If you made some code changes, chances are that you have to do a whole sequence of key-clicks and actions on the transmitter simulator in order to retest the same script after those changes. - -You can substatially reduce the effort of all this by using a script loader in your transmitter. This is nothing more then a function that will load and run your code. If you press the enter button, it will unload the current code, and ask if you want to run the code again. So, with just two clicks, you can unload the running code and reload your updated code. On the Taranis simulator, you can also reload the LUA scripts environment with just a buttonclick. - -An example of such a script is found under the notes. You can adapt it for other types of scripts of course. - -## Notes - -### Script Loader - -This script loader will load the file /SCRIPTS/TELEM/telem1.lua, run it, and wait for an Enter Break event. Once received, it will unload the code and wait for a next Enter Break event. - -```lua -local fileToLoad="/SCRIPTS/TELEM/telem1.lua" -local active = true -  -local thisPage={} -local page={} -  -local function clearTable(t) - if type(t)=="table" then - for i,v in pairs(t) do - if type(v) == "table" then - clearTable(v) - end - t[i] = nil - end - end - collectgarbage() - return t -end - -thisPage.init=function(...) - if active then - page=dofile(fileToLoad) - page.init(...) - end - return true -end -  -thisPage.background=function(...) - if active then - page.background(...) - end - return true -end -  -thisPage.run=function(...) - if active then - page.run(...) - active= not (...==EVT_ENTER_BREAK) - else - lcd.drawText( 15, 2, fileToLoad, 0 ) - lcd.drawText( 15, 20, "disabled", 0 ) - lcd.drawText( 15, 40,"press enter-button to activate",0) - clearTable(page) - active= (...==EVT_ENTER_BREAK) - thisPage.init() - end - return not (...==EVT_MENU_BREAK) -end -  -return thisPage -``` - diff --git a/part_iv_-_advanced_topics/lua_data_sharing_across_scripts.md b/part_iv_-_advanced_topics/lua_data_sharing_across_scripts.md deleted file mode 100644 index 9ee0c48c2..000000000 --- a/part_iv_-_advanced_topics/lua_data_sharing_across_scripts.md +++ /dev/null @@ -1,186 +0,0 @@ -# Lua data sharing across scripts - -## Overview: - -OpenTX considers all function, mix, and telemetry scripts to be 'permanent' scripts that share the same runtime environment. They are typically loaded at power up or when a new model is selected. However, they are also reinitialized when a script is added or removed during model editing. - -## Lua scoping rules: - -Any variable or function not declared local is implicitly global. Care must be taken to avoid unintentional global declarations, and ensure that the globals you intentionally declare have unique names to avoid conflicts with scripts written by others. - -## Example: - -This example consists of three scripts - -* **count-dn.lua** - this is a mix script than can be run stand alone to announce time remaining based on a user-defined switch and duration. It updates two global variables \(gCountUp and gCountDown\). It also creates output values \(ctup and ctdn\) which are for demonstration purposes only. -* **count-up.lua** - this is an optional function script which will do count up announcements based on harded coded values. -* **shocount.lua** - this is an optional telemetry script which simply shows the current values of the gCountUp and gCountDown variables. - -## Installation: - -* count-dn.lua - * copy to /SCRIPTS/MIXES - * configure on the transmitter CUSTOM SCRIPT page - * suggested switch = "SA" - * suggested mins = 3 - * suggested sw\_high = 0 - * screen image: - - ![count-dn.lua mix script](https://github.com/opentx/opentx-2-3-lua-reference-guide/tree/0d355d19f1961b689994cf78b84005864d33f9b5/count-dn.png) -* count-up.lua - * copy to /SCRIPTS/FUNCTIONS - * configure on the transmitter SPECIAL FUNCTIONS page - * suggested switch SA\(down\) - * screen image: - - ![count-up.lua function script](https://github.com/opentx/opentx-2-3-lua-reference-guide/tree/0d355d19f1961b689994cf78b84005864d33f9b5/count-up.png) -* shocount.lua - * copy to /SCRIPTS/TELEMETRY - * configure on the transmitter TELEMETRY page - * screen image: - - ![shocount.lua function script](https://github.com/opentx/opentx-2-3-lua-reference-guide/tree/0d355d19f1961b689994cf78b84005864d33f9b5/shocount.png) - -## Script sources: - -### count-dn.lua - -```lua --- these globals can be referenced in function and telemetry scripts -gCountUp = 0 -gCountDown = 0 - -local target -local running = false -local complete = false -local announcements = { 720, 660, 600, 540, 480, 420, 360, 300, 240, 180, 120, 105, 90, 75, 60, 55, 50, 45, 40, 35, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0} -local annIndex -- index into the announcements table (1 based) -local minUnit -- used by playNumber() for unit announcement - -local input = - { - { "switch", SOURCE}, -- switch used to activate count down - { "mins", VALUE, 1, 12, 2 }, -- minutes to count down - { "sw_high", VALUE, 0, 1, 1 } -- 0 = active when low, otherwise active when high - } - -local output = {"ctup", "ctdn" } - -local function init() - local version = getVersion() - if version < "2.1" then - minUnit = 16 -- unit for minutes in OpenTX 2.0 - elseif version < "2.2" then - minUnit = 23 -- unit for minutes in OpenTX 2.1 - else - minUnit = 25 -- unit for minutes in OpenTX 2.2 - end -end - -local function countdownIsRunning(switch, sw_high) - -- evaluate switch - return true if we should be counting down - if (sw_high > 0) then - return (switch > -1000) - else - return (switch < 1000) - end -end - -local function run(switch, mins, sw_high) - local timenow = getTime() -- 10ms tick count - local minutes - local seconds - - if (not countdownIsRunning(switch, sw_high)) then - running = false - complete = false - return 0, 0 -- ***** NOTE: early exit ***** - end - - if (complete) then - return 0, 0 -- must reset the switch before we go again - end - - if (not running) then - running = true - target = timenow + ((mins * 60) * 100) - annIndex = 1 - end - - gCountDown = math.floor(((target - timenow) / 100) + .7) -- + is adj. to for announcement lag - gCountUp = (mins * 60) - gCountDown - - while gCountDown < announcements[annIndex] do - annIndex = annIndex + 1 -- catch up - end - - if gCountDown == announcements[annIndex] then - minutes = math.floor(gCountDown / 60) - seconds = gCountDown % 60 - if minutes > 0 then - playNumber(minutes, minUnit, 0) - end - if seconds > 0 then - playNumber(seconds, 0, 0) - end - annIndex = annIndex + 1 - end - - if gCountDown <= 0 then - playNumber(0,0,0) - running = false - gCountDown = 0 - complete = true - end - - return gCountUp * 10.24, gCountDown * 10.24 -end - -return { input=input, output=output, init=init, run=run } -``` - -### count-up.lua - -```lua -gCountUp = 0 - -local min = 5 -local max = 30 -local last = 0 -local announcements = { 5, 10, 15, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 } -local annIndex = 1 - -local function run(e) - if not (gCountUp == last) then - last = gCountUp - for key, value in pairs(announcements) do - if value == last then - playNumber(last, 0, 0) - end - end - end -end - -return{run=run} -``` - -### shocount.lua - -```lua --- these globals can be referenced in mix, function, and telemetry scripts -gCountUp = 0 -gCountDown = 0 - -local function run(e) - lcd.clear() - lcd.drawText(1,1,"OpenTx Lua Data Sharing",0) - - lcd.drawText(1,11,"gCountUp:", 0) - lcd.drawText(lcd.getLastPos()+2,11,gCountUp,0) - lcd.drawText(1, 21, "gCountDown:", 0) - lcd.drawText(lcd.getLastPos()+2,21,gCountDown,0) -end - -return{run=run} -``` - diff --git a/part_iv_-_advanced_topics/optimization_tricks.md b/part_iv_-_advanced_topics/optimization_tricks.md deleted file mode 100644 index 8c4508c9b..000000000 --- a/part_iv_-_advanced_topics/optimization_tricks.md +++ /dev/null @@ -1,27 +0,0 @@ -# Speed/memory optimizaton tricks - -## Faster getValue() - -Normally one uses [getValue()](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getvalue.md) function with the source/filed name like so: - -```lua -local foo = getValue("bar") -``` - -This works and is recommended method for portability. But if a particular script needs to get the value of certain field a lot, then it is faster to use this syntax: - -```lua -local my_id = getFieldInfo("bar").id -- here we get the numerical id of the filed "bar" - -local function run_a_lot() - local my_value = getValue(my_id) -- exactly the same effect as local my_value = getValue("bar"), but faster -end -``` - -Why is this method faster? With the function [getFieldInfo(name)](../part\_iii\_-\_opentx\_lua\_api\_reference/general-functions-less-than-greater-than-luadoc-begin-general/getfieldinfo.md) we get the `numerical id` of the wanted filed. The function has to find the requested value by its name in the table of all available sources. That search takes some time. - -When we use this syntax the search is only done once. In comparison in the first example the search must be performed every time `getValue("bar")` is called. - -So when the `getValue(my_id)` is called the search can be skipped and the requested value if fetched directly. - -Of course there is a trade-of, the second example uses little more memory (for variable `my_id`). diff --git a/part_iv_-_converting_opentx_20_scripts.md b/part_iv_-_converting_opentx_20_scripts.md deleted file mode 100644 index df9829887..000000000 --- a/part_iv_-_converting_opentx_20_scripts.md +++ /dev/null @@ -1,6 +0,0 @@ -# Part IV - Converting OpenTX 2.0 Scripts - -The handling of telemetry data is significantly improved in OpenTX 2.1. However, in order to support the additional flexibility of having multiple sensors of the same type, many Lua scripts referencing GPS and Lipo sensor data will require revision. - -This section also covers some of the requirements for scripts that are necessary for them to function properly under both OpenTX 2.1 and OpenTX 2.0. - diff --git a/part_vi_-_advanced_topics.md b/part_vi_-_advanced_topics.md deleted file mode 100644 index 7dd3a7bde..000000000 --- a/part_vi_-_advanced_topics.md +++ /dev/null @@ -1,3 +0,0 @@ -# Part VI - Advanced Topics - -The advanced topics section covers file i/o, data sharing, and debugging techniques \ No newline at end of file diff --git a/part_vii_-_appendix.md b/part_vii_-_appendix.md deleted file mode 100644 index 6bac8da68..000000000 --- a/part_vii_-_appendix.md +++ /dev/null @@ -1,3 +0,0 @@ -# Part VII - Appendix - -Various additional documents \ No newline at end of file diff --git a/return_statement_syntax.md b/return_statement_syntax.md deleted file mode 100644 index 84466ffa3..000000000 --- a/return_statement_syntax.md +++ /dev/null @@ -1,22 +0,0 @@ -# Return Statement Syntax - -The return statment is the last statement in an OpenTX Lua script. It defines the input/output table values and functions used to run the script. - -Parameters *init*, *input* and *output* are optional. If a script doesn't use them, they can be omitted from return statement. - -Example without *init* and *output*: - -```lua -local inputs = { { "Aileron", SOURCE }, { "Ail. ratio", VALUE, -100, 100, 0 } } - -local function run_func(ail, ratio) - -- do some stuff - if (ail > 50) and ( ratio < 40) then - playFile("foo.wav") - end -end - --- script that only uses input and run -return { run=run_func, input=inputs } -``` -  \ No newline at end of file diff --git a/run_function_syntax.md b/run_function_syntax.md deleted file mode 100644 index d9fbbfcab..000000000 --- a/run_function_syntax.md +++ /dev/null @@ -1,44 +0,0 @@ -# Run Function Syntax - -The run function is the function that is periodically called for the lifetime of script execution. Syntax of the run function is different between [mix scripts](mix.md) and [telemetry scripts](telemetry.md). - - ---- - - -#### Run Function for Mix Scripts -```lua -local function ([first input, [second input], …]) - - -- if mix has no return values - return - - -- if mix has two return values - return value1, value2 - -end -``` -* #####Input parameters: -zero or more input values, their names are arbitrary, their meaning and order is defined by the input table. (see [Input Table Syntax](input_table_syntax.md)) - -* #####Return values: - - none - if output table is empty (i.e. script has no output) - values
\- or \- - - comma separated list of output values, their order and meaning is defined by the output table. (see [Output Table Syntax](output_table_syntax.md)) - - - ---- - - -####Run Function for Telemetry Scripts -```lua -local function (key-event) - return 0 -- values other than zero will halt the script -end -``` - -* #####Input parameters: -The *key-event* parameter indicates which transmitter button has been pressed (see [Key Events](key_events.md)) -* #####Return values: -A non-zero return value will halt the script diff --git a/telemetry.md b/telemetry.md deleted file mode 100644 index dedd05c30..000000000 --- a/telemetry.md +++ /dev/null @@ -1,56 +0,0 @@ -##Telemetry Scripts - -## General description - -Telemetry scripts are used for building customized screens. Each model can have up to three active scripts as configured on the model's telemetry configuration page. The same script can be assigned to multiple models. - -## File Location - -Scripts are located on the SD card in the folder /SCRIPTS/TELEMETRY/<*name*>.lua. File name length (without extension) **must be 6 characters or less** (this limit was 8 characters in OpenTX 2.1). - -## Lifetime of telemetry script - -Telemetry scripts are started when the model is loaded. - -* script init function is called -* script background function is periodically called when custom telemetry screen is **not visible**. *Notice*: - * In OpenTX 2.0 this function is **not called** when the custom telemetry screen is visible. - * Starting from OpenTX 2.1 this function is **always called** no matter if the custom screen is visible or not. -* script run function is periodically called when custom telemetry screen is **visible** -* script is stopped and disabled if it misbehaves (too long runtime, error in code, low memory) -* all telemetry scripts are stopped while one-time script is running (see Lua One-time scripts) - -## Script interface definition - -Every script must include a return statement at the end, that defines its interface to the rest of OpenTX code. This statement defines: -* script **init** function *(optional)* -* script **background** function -* script **run** function - -### Example (interface only): - -```lua -local function init_func() - -- init_func is called once when model is loaded -end - -local function bg_func() - -- bg_func is called periodically (always, the screen visibility does not matter) -end - -local function run_func(event) - -- run_func is called periodically only when screen is visible -end - -return { run=run_func, background=bg_func, init=init_func } -``` - -### Notes: - -* `init_func()` function is called once when script is loaded and begins execution. - -* `bg_func()` is called periodically, the screen visibility does not matter. - -* `run_func(event)` function is called periodically when custom telemetry screen is visible. The `event` parameter indicates which transmitter button has been pressed (see [Key Events](key_events.md)). This is the time when the script has full control of the LCD screen and keys and should draw something on the screen. - - diff --git a/theme_scripts.md b/theme_scripts.md deleted file mode 100644 index d6b7cf3f2..000000000 --- a/theme_scripts.md +++ /dev/null @@ -1,3 +0,0 @@ -# Theme Scripts - -TODO: describe how theme scripts work on Horus type transmitters. \ No newline at end of file diff --git a/widget_scripts.md b/widget_scripts.md deleted file mode 100644 index 61d074e8f..000000000 --- a/widget_scripts.md +++ /dev/null @@ -1,110 +0,0 @@ - -# Widgets (HORUS ONLY) Scripts - -#### General description - -Widgets are small scripts that show some info in a 'zone' in one of the model specific user defined (telemetry) screens. You can define those screens within the telemetry menu on the HORUS. - -Each model can have up to five custom screens, with up to 8 widgets per screen, depending on their size and layout. Each instance of a widget has his own custom settings. - -#### File Location - -Widgets are located on the SD card, each in their specific folder /WIDGETS/<*name*>/main.lua (*name* must be in 8 characters or less). - -#### Lifetime of widgets - -Widgets need to be registered through the telemetry setup menu. - -* widget create function is called -* widget update function is called upon registration and at change of settings in the telemetry setup menu. -* widget background function is periodically called when custom telemetry screen is **not visible**. *Notice*: - * This is different from the way telemetry scripts are handled -* widget refresh function is periodically called when custom telemetry screen is **visible** -* widget is stopped and disabled if it misbehaves (too long runtime, error in code, low memory) -* all widgets are stopped while one-time script is running (see Lua One-time scripts) - -Once registered, widgets are started when the model is loaded. - -#### Script interface definition - -Every widget must include a return statement at the end, that defines its interface to the rest of OpenTX code. This statement defines: -* widget **name** (*name* must be a string of 10 characters or less) -* widget **options** array (maximum five options are allowed, 10 character names max, no spaces!) -* widget **create** function -* widget **update** function -* script **background** function -* script **refresh** function - -##### Example (draws a moving counter that counts only when not visible): - -```lua -local defaultOptions = { - { "ControlX", SOURCE, 1 }, - { "ScrollZ", BOOL, 1 }, -- BOOL is actually not a boolean, but toggles between 0 and 1 - { "StepZ", VALUE, 1, 0, 10}, - { "COLOR", COLOR, RED }, -} - -local function createWidget(zone, options) - lcd.setColor( CUSTOM_COLOR, options.COLOR ) - -- the CUSTOM_COLOR is foreseen to have one color that is not radio template related, but it can be used by other widgets as well! - local someVariable = 0 - local anotherVariable = {xWidget=0, yWidget = 0} - return { zone=zone, options=options , someVariable = someVariable, anotherVariable=anotherVariable } -end - -local function updateWidget(widgetToUpdate, newOptions) - widgetToUpdate.options = newOptions - lcd.setColor( CUSTOM_COLOR, widgetToUpdate.options.COLOR ) - -- the CUSTOM_COLOR is foreseen to have one color that is not radio template related, but it can be used by other widgets as well! -end - -local function backgroundProcessWidget(widgetToProcessInBackground) - local function process(...) - return ... + 1 - end - widgetToProcessInBackground.someVariable = process (widgetToProcessInBackground.someVariable) -end - -local function refreshWidget(widgetToRefresh) - local counterLength = 50 - local counterHeight = 30 - - --backgroundProcessWidget(widgetToRefresh) - --background is not called automatically in display mode, so do it here if you need it. - - local function anotherProcess(parameter,step,maxParameter) - return (parameter + step) % maxParameter - end - - widgetToRefresh.anotherVariable.xWidget - = anotherProcess ( widgetToRefresh.anotherVariable.xWidget - ,getValue(widgetToRefresh.options.ControlX)/10.24/20 - ,widgetToRefresh.zone.w-counterLength) - - widgetToRefresh.anotherVariable.yWidget - = anotherProcess ( widgetToRefresh.anotherVariable.yWidget - ,(widgetToRefresh.options.ScrollZ==1) and widgetToRefresh.options.StepZ or 0 - ,widgetToRefresh.zone.h-counterHeight) - - lcd.drawNumber(widgetToRefresh.anotherVariable.xWidget + widgetToRefresh.zone.x - , widgetToRefresh.anotherVariable.yWidget + widgetToRefresh.zone.y - , widgetToRefresh.someVariable - , LEFT + DBLSIZE + CUSTOM_COLOR); -end - -return { name="MovingCntr", options=defaultOptions, create=createWidget, update=updateWidget - , refresh=refreshWidget, background=backgroundProcessWidget } -``` - -#### Notes: - -* *options* are only passed through to OpenTX to be used on widget creation. Don't change them during operation, this has no effect. -* *create()* function is called once when widget is loaded and begins execution. -* *update()* function is called once when widget is loaded and begins execution. -* *background()* is called periodically when custom telemetry screen containing widget is not visible. -* *refresh()* function is called periodically when custom telemetry screen containing wodget is visible. - -* in the example given, you can see that no global variables or functions are needed to operate the widget. -* variables that are used throughout the widget, can best be declared *inside* the create function as local variables -* those local variablkes can then be passed through to the other functions as an element of the widget array that is returned diff --git a/wizard.md b/wizard.md deleted file mode 100644 index 04301eaeb..000000000 --- a/wizard.md +++ /dev/null @@ -1,5 +0,0 @@ -# Wizard - -
-TODO: Need to determine status of wizard in 2.2 -
\ No newline at end of file