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:
local cellValue ="unknown"local cellResult =nillocal cellID =nillocalfunctiongetTelemetryId(name) field =getFieldInfo(name)if field thenreturn field.idelsereturn-1endendlocalfunctioninit() cellId =getTelemetryId("Cels")endlocalfunctionbackground() cellResult =getValue(cellId)if (type(cellResult) =="table") then cellValue =""for i, v inipairs(cellResult) do cellValue = cellValue .. i ..": " .. v .." "endelse cellValue ="telemetry not available"endendlocalfunctionrun(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)endreturn{init=init,run=run,background=background}