#Radio Panal Config help

1 messages · Page 1 of 1 (latest)

rare shuttle
#

Ok, I have successfully created a working COM1 radio. I know would like to add a toggle switch so that when it's in position 1 (on) the encoder changes com1 and when its in position 2 (off) the encoder changes Com2 any ideas?

hushed kettle
#

ok

#

so the way you can do this

#

is with preconditions

#

you create two configurations

#

that you can test independently, by checking the active checkboxes off and on on each config at a time

#

so either one works independently

#

and shows the correct radio

#

so the display if you have one, and the encoder and possible switches

#

they just use the same hardware devices

#

then you create an input config for the switch

#

and make it change a MobiFlight variable to 1 or 0 based on the switch position

#

so OnPress set RadioSelected = 1

#

and 0 on the other

#

(variables are initialized as 0 so its easier if one is 0 so it also works on startup

#

and then add precondition to the two different radio configs

#

one works only when RadioSelected = 1

#

and the other when it is 0

#

you see the red exclamation marks on the configs when a config is NOT active

#

preconditions just make mobiflight skip a config

#

so you can have two separate configs use the same encoder and displays as long as the preconditions are mutually exclusive

rare shuttle
#

I think I was on the right track with this. This is what I had

hushed kettle
#

yes

rare shuttle
#

Just not sure how this corresponds to the switch position

#

and should it be in an analogue pin or a digital pins?

naive ridge
#

If it is a switch, go back and change the hardware device config to "Button" and upload to the board before proceeding.

#

once you have the button config device correctly, it will show in the input config as "on press" and "on release" tabs.