Writing Lua Widgets for Horus
Writing Lua Widgets for Horus
I want to start creating Widgets for my Horus X10S
Is there a place where I can find some basic information about Lua scripting?
Is there a place where I can find some basic information about Lua scripting?
Re: Writing Lua Widgets for Horus
There are some widgets writen in LUA to understand the basic structure. Details on available functions is here : https://legacy.gitbook.com/book/opentx/ ... de/details
Re: Writing Lua Widgets for Horus
Thanks 3djc.
Just what I was looking for!!!
Just what I was looking for!!!
Re: Writing Lua Widgets for Horus
I am trying to create the following.
I want to display a map of our field on the screen of my FrSky Horus.
On top of this image I want to have an Icon of an Airplane showing my location on this map based on GPS data from my plane.
So far I managed to get the map image displayed and I can draw lines ontop of this image.
Can someone assist me in getting the GPS telemetry data into the Lua script?
I need the actual GPS Latitude and Longitude and the heading.
The final result should not only show me where I am but also warn me when I cross the red line, because then I am entering a now flight zone.
I already found a solution for calculating when you cross the line.
I have everything functional in an Excel sheet, but I am completely new to Lua and writing Widgets for OpenTx. Also a lot of information in the OpenTx 2.2 Lua manual is based on the Taranis monochrome screen.
By the way is it possible to draw thicker lines with the function drawline, or should I keep doing as I did, draw multiple lines next to each other?
I want to display a map of our field on the screen of my FrSky Horus.
On top of this image I want to have an Icon of an Airplane showing my location on this map based on GPS data from my plane.
So far I managed to get the map image displayed and I can draw lines ontop of this image.
Can someone assist me in getting the GPS telemetry data into the Lua script?
I need the actual GPS Latitude and Longitude and the heading.
The final result should not only show me where I am but also warn me when I cross the red line, because then I am entering a now flight zone.
I already found a solution for calculating when you cross the line.
I have everything functional in an Excel sheet, but I am completely new to Lua and writing Widgets for OpenTx. Also a lot of information in the OpenTx 2.2 Lua manual is based on the Taranis monochrome screen.
By the way is it possible to draw thicker lines with the function drawline, or should I keep doing as I did, draw multiple lines next to each other?
Re: Writing Lua Widgets for Horus
Thanks for all the help.
I have my first Widget working. There are still some small issues but it works!!!
https://youtu.be/rxGZqBGFMuc
I have my first Widget working. There are still some small issues but it works!!!
https://youtu.be/rxGZqBGFMuc
Re: Writing Lua Widgets for Horus
Have changed the code today.
Update time was very poor.
Around once a second. Now with chanced code its more then 15 times a second.
Will do testflight tomorrow
Update time was very poor.
Around once a second. Now with chanced code its more then 15 times a second.
Will do testflight tomorrow
Re: Writing Lua Widgets for Horus
Update time is great now. Very happy with the results.
Re: Writing Lua Widgets for Horus
Newbie to OpenTX 2.2.3, now have it on my FrSky X12S (I have been using Ersk9x on my 9XRPro and my QX7) -- I use MLVSS in my larger planes and have an audio special function to audio/read out flight pack voltage -- that works ok for me. I also use a widget (on FrSKy X12S) to display pack voltage and remaining percentage -- that works ok for me, also. But, how do I have an audio/read out of the PERCENTAGE remaining figure (not the voltage) of flying power? I usually like to start to make my landing approaches at 20% remaining, to give a margin for go-arounds, if necessary.
I can only see how to display remaining % in the widget, not play it as a value.
In ErSky9x, without LUA or any other programming, I could read the pack voltage telemetry data, feed it to a Global Scaler, offset/deduct the minimum pack voltage I am prepared to fly with and then convert the remaining amount as a percentage amount and audio that out.
I cannot see how to achieve that in OpenTX. I've tried Adding a New Sensor (Custom), I've tried Global Variable Change, I've tried Special Function options, I've tried creating a new Input. To no avail. Can only audio remaining voltage, but not remaining percentage.
Can some of the more experienced OpenTX users enlighten me to the trick (without using LUA scripting) if it exists, please?
TIA
ozphoenix
I can only see how to display remaining % in the widget, not play it as a value.
In ErSky9x, without LUA or any other programming, I could read the pack voltage telemetry data, feed it to a Global Scaler, offset/deduct the minimum pack voltage I am prepared to fly with and then convert the remaining amount as a percentage amount and audio that out.
I cannot see how to achieve that in OpenTX. I've tried Adding a New Sensor (Custom), I've tried Global Variable Change, I've tried Special Function options, I've tried creating a new Input. To no avail. Can only audio remaining voltage, but not remaining percentage.
Can some of the more experienced OpenTX users enlighten me to the trick (without using LUA scripting) if it exists, please?
TIA
ozphoenix
Re: Writing Lua Widgets for Horus
Please do not crosspost your issue, specialy if you ask for non LUA solution in a thread ABOUT LUA ...
3djc
3djc
Re: Writing Lua Widgets for Horus
Thanks for answering my question, over in the other post (even though you have said it probably can't be done easily in OpenTX without using LUA).
Re: Writing Lua Widgets for Horus
I have a t16 and im trying to have a string of text file showup in a widget or a picture just trying to store some info on settings etc on the lCD any idea where to start