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
OscarJ149
Posts: 1
Hi,

I've looked at the stickied post in this forum about this matter and I can't seem to solve my problem. I'm thinking of running LINDA for inputs and using MobiFlight for outputs.

An example of the problem I'm having is getting an LED connected to a MEGA to turn on when the APU master light is on in the aerosoft a32x. I guess The LVar would be AB_OVH_APU_MASTER_LIGHT_ON. I've tried setting that to offset 0x66C0 using this code.

iconCode:

function AB_OVH_APU_MASTER_LIGHT_ON(offset, value)
	if (value == 1) then ipc.writeLvar("AB_OVH_APU_MASTER_LIGHT_ON", 1) 
	else ipc.writeLvar("AB_OVH_APU_MASTER_LIGHT_ON", 0) 
	end
end

event.offset("66C0","UB",""AB_OVH_APU_MASTER_LIGHT_ON", 1")



I saved this as a .lua file in Prepar3D v4/Modules as AB_OVH_APU_MASTER_LIGHT_ON.lua and added a line to [luafiles] in fsuipc6.ini
[LuaFiles]
1=ipcReady
2=LINDA
3=lib-arduinoLEDs
4=AB_OVH_APU_MASTER_LIGHT_ON

I set up mobiflight with the correct offset and LED pin. Testing the LED makes the LED work as expected, but when I save and run the program nothing happens when I switch APU master on in the cockpit. Using the LINDA Console, I can see the LVar AB_OVH_APU_MASTER_LIGHT_ON changes when I press the switch and the light goes on, but the FSUIPC Value and Output Value in mobiflight stay 0 and the LED connected to the Mega is still off.

Any help would be greatly appreciated

Many Thanks
Oscar
2021-02-20 17:25
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi Oscar.

This makes no sense.....

Your Code represent the INPUT !
iconCode:
function AB_OVH_APU_MASTER_LIGHT_ON(offset, value)
	if (value == 1) then ipc.writeLvar("AB_OVH_APU_MASTER_LIGHT_ON", 1) 
	else ipc.writeLvar("AB_OVH_APU_MASTER_LIGHT_ON", 0) 
	end
end

event.offset("66C0","UB",""AB_OVH_APU_MASTER_LIGHT_ON", 1")


This Code say..... Check Offset 66C0 ..... If Offset is "1" then write the Lvar to ON Else write the LVar to OFF.
So this Lua Code is used to make a INPUT..... If you run it and you WRITE with Mobiflight the Offset 66C0 to 1 or 0 THEn thi code would see this write and excecute the commands !


************
What you need is a code that READ the Lvar and write this Data to a Offset..... And finaly you read that Offset with Mobiflight !
Good Luck !
2021-02-20 19:01
icon