Multifunction Momentary Switch
This tutorial shows you how to get more out of your momentary switch. Its pretty simple to set up the momentary switch to do something, like reset a timer or read out your current altitude. But, what if we want it to do more than that? What if we want it to reset the timer and read out the current altitude, and I’m not talking stacking the special functions. We can do it so that a quick flick reads the altitude, a hold of 2-4 seconds tells you your pack voltage, 4-6 seconds enters the iNav OSD menu, and 6-8 seconds resets the timer. These are all just examples, what you can do is only limited by your imagination, how well you can remember a beep sequence, and how long you can hold your finger on the switch. The most important thing is to order your options, so that the things you may want to activate in flight are sooner, and things that can be done on the ground are later in the list.
How this is set up
I’ve tried to come up with a concept to easier explain this functionality. What I’ve come up with is to call each command a switch “position”. Each switch “position” is comprised of 2 logical switches and 2 special functions (for basic operations). The first logical switch sets the beginning of the position, which triggers a special function to make a sound. I’m just using beeps, but you could have a different sound for each position. You could even have a voice to say what each position is, but you would need to lengthen the size of the position. The idea is, as soon as you hear the sound you want, let go of the momentary switch.
The second logical switch defines the length of and captures the release of the momentary switch. In some cases, w need to add an extra logical switch. For example, if you want to have a switch position to enter the iNav OSD menu, we must make sure that the system is disarmed before we can grant access. The triggering of this logical switch will enable the special function to do it’s thing.
In the example below, I have set up 4 switch positions:
- Position 1 – When the switch is flicked, it will read out the altitude
- Position 2 – Enter the iNav OSD menu
- Position 3 – Calibrate the compass
- Position 4 – Reset the flight timer
As I said earlier, you can pretty much get this to do anything. But, I thought these examples may be useful to people.
Full OpenTX Code
|L01||a > x||SH||90||---||0.0||0.1||Position 1 sound trigger|
|L02||EDGE||SH↓||0.1 | 2.0||---||---||---||Position 1 action|
|L03||a > x||SH||90||---||0.0||2.1||Position 2 sound trigger|
|L04||EDGE||SH↓||2.1 | 4.0||SF↑||---||---||Position 2 armed action|
|L05||EDGE||SH↓||2.1 | 4.0||SF↓||1||---||Position 2 unarmed action|
|L06||a > x||SH||90||---||0.0||4.1||Position 3 sound trigger|
|L07||EDGE||SH↓||4.1 | 6.0||SF↑||---||---||Position 3 armed action|
|L08||EDGE||SH↓||4.1 | 6.0||SF↓||1||---||Position 3 unarmed action|
|L09||a > x||SH||90||---||0.0||6.1||Position 4 sound trigger|
|L10||EDGE||SH↓||6.1 | 8.0||---||---||---||Position 4 action|
|SF01||L01||Play Sound||Beep 1||No repeat||Position 1 sound|
|SF02||L02||Play Value||Alt||No repeat||Position 1 action - play altitude|
|SF03||L03||Play Sound||Beep 2||No repeat||Position 2 sound|
|SF04||L04||Play Track||Disarm||No repeat||Position 2 action - we are armed, so play a track telling us to disarm|
|SF05||L05||Override CH2||100||✔ ON||Position 2 action - show OSD menu|
|SF06||L05||Override CH3||0||✔ ON||Position 2 action - show OSD menu|
|SF07||L05||Override CH4||-100||✔ ON||Position 2 action - show OSD menu|
|SF08||L06||Play Sound||Beep 3||No repeat||Position 3 sound|
|SF09||L07||Play Track||Disarm||No repeat||Position 3 action - we are armed, so play a track telling us to disarm|
|SF10||L08||Override CH2||-100||✔ ON||Position 3 action - calibrate compass|
|SF11||L08||Override CH3||100||✔ ON||Position 3 action - calibrate compass|
|SF12||L08||Override CH4||100||✔ ON||Position 3 action - calibrate compass|
|SF13||L09||Play Sound||Beep 1||No repeat||Position 4 sound|
|SF14||L10||Reset||Timer 1||✔ ON||Position 4 action - reset the timer|
This article has helped 111 people. For more useful things, please check out my YouTube Channel.