Taranis: A Volume Control That Doesn't Take Up Any Pots or Switches
for OpenTX version 2.1.9
Like my other scripts so far,
volume.lua is implemented like a telemetry script but doesn't actually provide telemetry. (But in this case it could with modification.) What it does is provide a way to adjust volume and store the setting without using any of the switches, knobs, or sliders that are otherwise used to control your model. Instead, the buttons next to the display are used.
The script needs one global variable ("GV"), which you can name "Volume." It can be any one of the nine global variables in each of your model memories and can even be a different GV for each model, although that would require multiple copies of volume.lua with minor changes to each copy and different filenames. I'm using GV1 in my radio and in the examples that follow.
There are installation instructions embedded in the script but I'll post more detailed instructions here.
One final note:
There's a function in the script that produces a tone to monitor the volume as you're adjusting it:
Code:
playTone(800, 50, 0, PLAY_NOW, 0)
The first parameter is 800, which sets the tone frequency to 800 Hz.
If you choose to modify the script to produce tones of varying frequency, beware of accidentally calling playTone() with a first parameter of zero because that will crash and reset the OpenTX operating system.