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! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
nicolapodda
From: EAST PERTH, Australia
Posts: 5
Supporter
Hi all,
I'm working with this variable here VC_OVHD_COMM_3_VHF1_Button_Top_Lt (bool*) to control one LED (on/off)

-- Annunciator ON
function Led_on (Lvarname, value)
ipc.writeUB(0x66D5, ipc.readLvar("VC_OVHD_COMM_3_VHF1_Button_Top_Lt"))
end
Led_on ("VC_OVHD_COMM_3_VHF1_Button_Top_Lt", ipc.readLvar("VC_OVHD_COMM_3_VHF1_Button_Top_Lt"))
event.Lvar("VC_OVHD_COMM_3_VHF1_Button_Top_Lt", 100, "Led_on")

This is the script I'm using, but it doesn't work. If I change the LVAR with a INT32 one instead the BOOL one, it works well.
Does someone have a solution and can explain me the logic?
Thanks
Nick
2022-07-26 13:48
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Here on our Discord are more advanced guys who can help.
I expect in forum it would be just a lucky punch if somebody would read this!

Basically i´m way confused about your code.

Questions:

1. What SIM do we talk about ?
2. What Aircraft do we talk about ?
( For most Situations we have a much better and easy way to do those things without Lua)

I also not fully understand this difficult logic you use! You say you just like to controll a LED . Means no Input action is done !!
All you need to do is "Read" the Lvar where the status is shown and "write" this information to a Custom Offset in FSUIPC to "store" it.

So you not need a specific line for LED ON or so.... You just say "Copy the Value of that Lvar permently to a Offset we can read within Mobiflight !
Good Luck !
2022-07-26 13:58
icon