Lua Script Tips

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
AlexF
Posts: 10
Joined: Tue Dec 08, 2015 9:40 pm
Country: -

Lua Script Tips

Post by AlexF »

Hi,

i have a Taranis and i like to have a special function.

I like to increasing or decreasing a current rc channel by a defined value by using a three-pos-switch.

In a second step i like to play a specific audio file assigned to the current channel value.

I guess Lua is the best way to archive this goal. But i have no Idea how to start.

Would be nice if someone could give me some hints. Like which type of script it will be (Model script, Function script)? Maybe some basic functions i need to know or Libraries i could use. Maybe a script like this already exists? Is Lua the way to go for this Task? Are there some basic example scripts for tasks like this?

Thanks a lot!

AlexF

athertop
Posts: 37
Joined: Sat Aug 08, 2015 12:19 pm
Country: -

Re: Lua Script Tips

Post by athertop »

You don't need to use LUA to do any of that stuff. You can do it on the Taranis directly without programming.

For the 3-pos switch to give specific values, start in the curves screen and create a 3 point curve with your three values (for those 3 positions) on the y axis. These will correspond with 100, 0, +100 on the x axis. Then on the Inputs screen, create a new input, configure it with with the 3-pos switch as required and assign the curve you created. Now when you go into the mixer and create a new mix against the channel you want this to effect, choosing the input you created as the mix source. Now when you move that 3 pos switch the three different values represented by the curve's y axis are output to the channel. For the sounds, go to the special functions page and assign a sound to each of the 3 positions for that switch.
Post Reply

Return to “openTx”