model.getInfo
Syntax
Parameters
Return values
API Status
Avail
Status
Comment
active
active
Change log
EdgeTX version
Change
Examples
Last updated
Was this helpful?
Was this helpful?
local modelInfo -- declare variable available to all functions
local function my_init() {
modelInfo = model.getInfo() -- read model's info table
}
local function my_run(event) {
lcd.clear()
lcd.drawText(0, 0, modelInfo.name) -- display model's name
return 0
}
return { run = my_run, init = my_init }local modelInfo -- declare variable available to all functions
local lineHeight = 8 -- for color radios change to 16
local function my_init() {
modelInfo = model.getInfo() -- read model's info table
}
local function my_run(event) {
lcd.clear()
local y = 0
for fieldName, fieldValue in pairs(modelInfo) do
lcd.drawText( 0, y, fieldName .. ": " .. tostring(fieldValue) ) -- display model's name
y = y + lineHeight
end
return 0
}
return { run = my_run, init = my_init }