MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

icon
Avatar
nico1984
Posts: 3
Hi guys,

last days i am progressing with macros and lvars quite well to controll my A2A C172.
But some switches do not stay on permanently but just for a sencond as I press the button which I assigned in FSUIPC.
I have those issues with switching on Announciator Panel Test or Flood Lights on/off. I wrote lua scripts for both to test but in each case
the buttons work just for a second and then return to off position.

Here is my lua for the Flood Light 1 Switch. I see the floodlight in the panel shining for half a second once i press the button assigned.
But how can I let it remain in the on-position? I had the same issue with writing simple Macros (L:FloodLight1Sitch=SET) ... and setting Values via FSUIPC or Mobiflight, it does not stay in the on position permanently.

function Flood_1_On ()
ipc.writeLvar("L:FloodLight1Switch", 1)
return
end

function Flood_1_Off ()
ipc.writeLvar("L:FloodLight1Switch", 0)
return
end

function Flood_1_Toggle ()
Flood1 = ipc.readLvar("L:FloodLight1Switch")
if Flood1 == 0 then
Flood_1_On ()
else
Flood_1_Off ()
end
return
end

Flood_1_Toggle ()
return

Can anyone help me?
Best regards
2022-12-27 00:19
icon