File tree Expand file tree Collapse file tree 11 files changed +65
-30
lines changed Expand file tree Collapse file tree 11 files changed +65
-30
lines changed Original file line number Diff line number Diff line change 28
28
* [ Key Event Constants] ( key_events.md )
29
29
* [ General Functions] ( general_functions.md )
30
30
* [ GREY()] ( general/GREY.md )
31
+ * [ defaultChannel()] ( general/defaultChannel.md )
32
+ * [ defaultStick()] ( general/defaultStick.md )
31
33
* [ getDateTime()] ( general/getDateTime.md )
32
34
* [ getFieldInfo()] ( general/getFieldInfo.md )
33
35
* [ getGeneralSettings()] ( general/getGeneralSettings.md )
39
41
* [ playFile()] ( general/playFile.md )
40
42
* [ playNumber()] ( general/playNumber.md )
41
43
* [ playTone()] ( general/playTone.md )
44
+ * [ popupInput()] ( general/popupInput.md )
42
45
* [ Model Functions] ( model/model_functions.md )
46
+ * [ model.defaultInputs()] ( model/defaultInputs.md )
47
+ * [ model.deleteInput()] ( model/deleteInput.md )
48
+ * [ model.deleteInputs()] ( model/deleteInputs.md )
43
49
* [ model.getGlobalVariable()] ( model/getGlobalVariable.md )
50
+ * [ model.getInput()] ( model/getInput.md )
51
+ * [ model.getInputsCount()] ( model/getInputsCount.md )
52
+ * [ model.insertInput()] ( model/insertInput.md )
44
53
* [ model.setGlobalVariable()] ( model/setGlobalVariable.md )
45
54
* [ model.setOutput()] ( model/setOutput.md )
46
55
* [ Display Functions] ( lcd/display_functions.md )
Original file line number Diff line number Diff line change 4
4
5
5
6
6
7
- Returns detailed information about a field
7
+ Returns detailed information about field (source)
8
+
9
+ @status current Introduced in 2.0.8
8
10
9
11
10
12
#### Parameters
11
13
12
- * ` name ` name of the field (string)
14
+ * ` name ` (string) name of the field
13
15
14
16
15
17
16
18
#### Return value
17
19
18
20
* ` table ` information about requested field, table elements:
19
- * ` id ` field identifier (number)
20
- * ` name ` field name (string)
21
- * ` desc ` field description (string)
21
+ * ` id ` (number) field identifier
22
+ * ` name ` (string) field name
23
+ * ` desc ` (string) field description
22
24
23
- * ` nil ` the requested filed was not found
25
+ * ` nil ` the requested field was not found
24
26
25
27
26
28
Original file line number Diff line number Diff line change 6
6
7
7
Returns (some of) the general radio settings
8
8
9
+ @status current Introduced in 2.0.6, ` imperial ` added in TODO
9
10
10
- #### Parameters
11
11
12
- * ` index ` zero based global variable index, use 0 for GV1, 8 for GV9
13
12
13
+ #### Parameters
14
14
15
+ none
15
16
16
17
#### Return value
17
18
@@ -23,4 +24,3 @@ Returns (some of) the general radio settings
23
24
24
25
25
26
26
-
Original file line number Diff line number Diff line change 4
4
5
5
6
6
7
- Returns current system time
7
+ Returns the time since the radio was started in multiple of 10ms
8
+
9
+ @status current Introduced in 2.0.0
8
10
9
11
10
12
#### Parameters
13
15
14
16
#### Return value
15
17
16
- * ` number ` current system time. Returned value is the
17
- number of 10ms periods since the radio start. Example:
18
+ * ` number ` Number of 10ms ticks since the radio was started Example:
18
19
run time: 12.54 seconds, return value: 1254
19
20
20
21
21
22
22
-
Original file line number Diff line number Diff line change 1
1
<!-- This file was generated by the script. Do not edit it, any changes will be lost! -->
2
2
3
- ## getValue(name_or_id )
3
+ ## getValue(source )
4
4
5
5
6
6
7
- Returns current value of the requested field.
7
+ Returns the value of a source.
8
+
9
+ The list of valid sources is available:
10
+ * for OpenTX 2.0.x at http://downloads-20.open-tx.org/firmware/lua_fields.txt
11
+ * for OpenTX 2.1.x at http://downloads-21.open-tx.org/firmware/lua_fields.txt
12
+
13
+ In OpenTX 2.1.x the telemetry sources no longer have a predefined name.
14
+ To get a telemetry value simply use its sensor name. For example:
15
+ * Altitude sensor has a name "Alt"
16
+ * to get the current altitude use the source "Alt"
17
+ * to get the minimum altitude use the source "Alt-", to get the maximum use "Alt+"
18
+
19
+ @status current Introduced in 2.0.0, changed in 2.1.0
8
20
9
21
10
22
#### Parameters
11
23
12
- * ` name_or_id ` identifier (number) or name (string) of the field
24
+ * ` source ` can be an identifier (number) (which was obtained by the getFieldInfo())
25
+ or a name (string) of the source.
13
26
14
27
15
28
16
29
#### Return value
17
30
18
- * ` value ` current field value (number). Zero is returned for:
19
- * non-existing fields
20
- * for all telemetry fields when the telemetry stream is not received
31
+ * ` value ` current source value (number). Zero is returned for:
32
+ * non-existing sources
33
+ * for all telemetry source when the telemetry stream is not received
21
34
22
35
* ` table ` GPS position is returned in a table:
23
36
* ` lat ` latitude, positive is North (number)
Original file line number Diff line number Diff line change 6
6
7
7
Returns OpenTX version
8
8
9
+ @status current Introduced in 2.0.0, expanded in 2.1.7
10
+
9
11
### Example
10
12
11
13
This example also runs in OpenTX versions where the radio version was not available:
Original file line number Diff line number Diff line change 1
1
<!-- This file was generated by the script. Do not edit it, any changes will be lost! -->
2
2
3
- ## killEvents(event )
3
+ ## killEvents(eventMask )
4
4
5
5
6
6
7
7
Cancels the key press propagation to the normal user interface algorithm.
8
8
9
+ @status current Introduced in 2.0.0
10
+
11
+ TODO table of events/masks
12
+
9
13
10
14
#### Parameters
11
15
12
- * ` event ` (number) event to be suppressed
16
+ * ` eventMask ` (number) events to be suppressed
13
17
14
18
15
19
Original file line number Diff line number Diff line change 4
4
5
5
6
6
7
- Plays a numerical value (text to speech)
7
+ Plays a time value (text to speech)
8
+
9
+ @status current Introduced in 2.1.0
8
10
9
11
10
12
#### Parameters
@@ -17,7 +19,6 @@ Plays a numerical value (text to speech)
17
19
18
20
19
21
20
-
21
22
#### Return value
22
23
23
24
none
Original file line number Diff line number Diff line change 4
4
5
5
6
6
7
- Plays a track with a given name
7
+ Plays a file from the SD card
8
8
9
+ @status current Introduced in 2.0.0, changed in 2.1.0
9
10
10
- #### Parameters
11
11
12
- * ` name ` (string) file name (including path) to play. If the path is not
13
- absolute (name starts with the ` / ` character), then the given name is used relative to
14
- the current language path (example for English language: ` /SOUNDS/en ` )
12
+ #### Parameters
15
13
14
+ * ` path ` (string) full path to wav file (i.e. “/SOUNDS/en/system/tada.wav”)
15
+ Introduced in 2.1.0: If you use a relative path, the current language is appended
16
+ to the path (example for English language: ` /SOUNDS/en ` is appended)
16
17
17
18
18
19
Original file line number Diff line number Diff line change 6
6
7
7
Plays a numerical value (text to speech)
8
8
9
+ @status current Introduced in 2.0.0
10
+
9
11
10
12
#### Parameters
11
13
12
14
* ` value ` (number) number to play. Value is interpreted as integer.
13
15
14
16
* ` unit ` (number) unit identifier (see table todo)
15
17
16
- * ` attributes ` possible values:
18
+ * ` attributes ` (unsigned number) possible values:
17
19
* ` 0 or not present ` plays integral part of the number (for a number 123 it plays 123)
18
20
* ` PREC1 ` plays a number with one decimal place (for a number 123 it plays 12.3)
19
21
* ` PREC2 ` plays a number with two decimal places (for a number 123 it plays 1.23)
20
22
21
23
22
24
23
-
24
25
#### Return value
25
26
26
27
none
You can’t perform that action at this time.
0 commit comments