Lua Widget Options in 2.2 on Horus

openTx has introduced a range of new features, ideas and bling. It is fast becoming the firmware of choice for many users. openTx will run on ALL current hardware platforms, including the gruvin9x and sky9x boards. Work has already started to support the new FrSky X9D radio!
Post Reply
rcbebo82
Posts: 15
Joined: Mon Mar 14, 2016 2:20 pm
Country: -

Lua Widget Options in 2.2 on Horus

Post by rcbebo82 »

Im currently developing a telemetry script.
Is it possible to add a Option where i can enter a precesion 2 value like "3.25" or is the value option limited to integer values?

Code: Select all

-- Widget Options
local options = {
  { "CelMinV", VALUE, 346 }, -- This is read as 3,46
  { "CelMaxV", VALUE, 426 }, -- This is read as 4,26
  { "Cels1", SOURCE, 1 },
  { "Cels2", SOURCE, 1 }
}

rabono
Posts: 85
Joined: Mon Sep 03, 2012 7:03 am
Country: -
Location: Los Angeles< USA

Re: Lua Widget Options in 2.2 on Horus

Post by rabono »

rcbebo82 wrote:Im currently developing a telemetry script.
Is it possible to add a Option where i can enter a precesion 2 value like "3.25" or is the value option limited to integer values?

Code: Select all

-- Widget Options
local options = {
  { "CelMinV", VALUE, 346 }, -- This is read as 3,46
  { "CelMaxV", VALUE, 426 }, -- This is read as 4,26
  { "Cels1", SOURCE, 1 },
  { "Cels2", SOURCE, 1 }
}
Somebody wrote a script like this http://rcsettings.com/index.php/viewdow ... e-announce? but in fact it is not working out of the box somebody modified it for me in order to have it functional If you need it I can send it to you.
rcbebo82
Posts: 15
Joined: Mon Mar 14, 2016 2:20 pm
Country: -

Re: Lua Widget Options in 2.2 on Horus

Post by rcbebo82 »

Currently i divide the value by 100 so its working now. In the script you post the same is done.
But it would be finer if it is possible to directly enter a value like "3.26"
rabono
Posts: 85
Joined: Mon Sep 03, 2012 7:03 am
Country: -
Location: Los Angeles< USA

Re: Lua Widget Options in 2.2 on Horus

Post by rabono »

Anyway Here the same but fixed the credit goes to a Swiss guy on a french forum who helped me sometime ago with it.
line 32 is for 2.1x need to be changed with 0167.waw for 2.2
Attachments
2cell.lua
(1.3 KiB) Downloaded 392 times
rcbebo82
Posts: 15
Joined: Mon Mar 14, 2016 2:20 pm
Country: -

Re: Lua Widget Options in 2.2 on Horus

Post by rcbebo82 »

Anyone has any source where i can get documentation for general widget options?
The currently published documentation is sadly incomplete. (https://www.gitbook.com/book/opentx/ope ... de/details)
Im currently looking for a option which can be set to true or false like a Checkbox ... or something.

Post Reply

Return to “openTx”