#Mobiflight overloading a push button switch not functioning

1 messages · Page 1 of 1 (latest)

jagged mural
#

I am trying to create a very simple MF variable for altitude increment "ALTINC" which will enable me to change the altitude by 100 ft/1000 ft. I have a single push button which should switch between the two values, since my other inputs have the "ALTINC" value as a precondition.

I can get this working when using the "On Hold" input setting with a delay, but it will not function when set to any other type of input setting (on press, on release). I don't know why it only works with "On Hold" and not the other settings. Can someone please explain this behavior, or give me an idea on how to fix it so I can implement it to on press or on release? Thank you!

#

The "On Hold" feature works above, but changing the same settings to On Press will not work

shrewd sun
#

To understand, what values do you want ALTINC to take? Push 1 and push again 0?

shrewd sun
#

In other words, push button sets Alt increment to 100. Push same bottom again sets the Alt increment to 1000. Correct?

jagged mural
#

That's correct. I have the preconditions set properly so only one or the other will be active. However it only works with the button hold and not the button push.

#

I can decrease the button hold duration to incredibly short so it works like a push (10 ms hold) but it boggles me why it must be in this mode for this variable to work

shrewd sun
#

You don't need any preconditions to toggle a variable between 0 and 1.

#

Just set the variable ALTINC to a value of 1-$

#

This formula will alternate value between 0 and 1 with every button press.

jagged mural
#

That's a very elegant solution

jagged mural
#

I still can't figure out why the original didn't work with button push but this is a better option overall

shrewd sun
#

In general, I am very weary of setups with preconditions that depend on the value of the same variable they are trying to act upon. I try to avoid that situation.
I think the outcome can be dependent on the order of how things are executed. I have seen this work OK, but I still find it uneasy for me to adopt.