Tx16s as a joystick doesn't work

I’d be inclined to avoid sending the message if not armed (e.g. implement it in Cockpit), but you could do either (or both) depending on your requirements.

For the Cockpit approach, you could:

  1. Add a data-lake variable to represent the switch state (e.g. “switch”)
  2. Add a compound data-lake variable for the armed state (e.g. “armed”)
    • This is then re-usable - if you’re only using it once you can merge it into the next step
  3. Add a compound data-lake variable for the conditional switch state (e.g. “switch if armed”)
    • {{ armed }} ? {{ switch }} : false
    • look up the javascript ternary operator to understand how that expression works
  4. Create a custom Action which makes use of the {{ switch-if-armed }} variable (or a compound variable that converts the 0/1 switch values into values that are more meaningful to your function, like PWM values), and gets auto-triggered when that variable changes.

may be worth referring to as examples, but feel free to follow up if something isn’t clear / working as expected :slight_smile:

2 Likes