HI,
to save on the number of pins used I find myself inventing solutions to exploit the analog inputs to the maximum;
in this case I try to implement the apu control using a switch and a button as I have not found a low cost on-off-push device.
using the attached diagram you have a similar function where apu start works only when the switch is on apu on (open).
I also attach the values detected on the analog input on the mobiflight debug where you can see that transient readings of the input value occur with each maneuver.
finally, the stable values are:
apu off = 14
apu on = 408
apu start = 661
in the end I think my problem is always the correct syntax to use in the preset code:
@ near sp0
l0 25 < if{
50 (L:switch_118_73X) - 10 div == if{ 11802 (>K:ROTOR_BRAKE) }
quit}
(l0 430 <) && (l0 380 >) if{
(L:switch_118_73X) 10 div == if{ 11801 (>K:ROTOR_BRAKE) }
quit}
l0 620 > if{
50 (L:sswitch_118_73X) - 10 div == if{ 11801 (>K:ROTOR_BRAKE) } els{ 11801 (>K:ROTOR_BRAKE)
11801 (>K:ROTOR_BRAKE) }
}
Thanks for your help