getValue(source)¶
Returns the value of a source.
The list of fixed sources:
| OpenTX Version | Radio |
|---|---|
| 2.0 | all |
| 2.1 | X9D and X9D+, X9E |
| 2.2 | X9D and X9D+, X9E, Horus |
| 2.3 | X9D and X9D+, X9E, X7, Horus |
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¶
sourcecan be an identifier (number) (which was obtained by the getFieldInfo())
or a name (string) of the source.
Return value¶
valuecurrent 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
tableGPS position is returned in a table:lat(number) latitude, positive is Northlon(number) longitude, positive is Eastpilot-lat(number) pilot latitude, positive is Northpilot-lon(number) pilot longitude, positive is EasttableGPS date/time, see getDateTime()tableCells 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.