Source:value¶
since 1.1.0
Return the source value / Set the source value on Lua sources / Vars / Telemetry sensors.
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
options |
table / number | optional |
Returns¶
value (nil / integer / number / string)
Examples¶
From the official Ethos documentation
source = system.getSource({name="GPS", options=OPTION_LATITUDE})
print(source:value())
More from the official documentation
source = system.getSource("LiPo", options=OPTION_CELLS_COUNT)
print(source:value())
source = system.getSource("LiPo")
print(source:value({options=OPTION_CELLS_COUNT}))
print(source:value({options=OPTION_CELL_INDEX(1)}))