Fritz Posted April 23, 2011 Report Posted April 23, 2011 Hi Pete, if I turn the autopilot off, the Caution LED should flash three times. Is it possible to realize this with Lua? If so, would you give me a hint how the code-line should look like? Regards Fritz
Pete Dowson Posted April 23, 2011 Report Posted April 23, 2011 if I turn the autopilot off, the Caution LED should flash three times. Should it? What aircraft is this with? Is it possible to realize this with Lua? Where is this LED? If so, would you give me a hint how the code-line should look like? Since I don't know what device you are using which has an LED I can't say whether it is easily drivable from Lua or not. Regards Pete
Fritz Posted April 23, 2011 Author Report Posted April 23, 2011 I mean the Master Warning which should flash 3 times when the autopilot is switched off in the A320. Please have a look at this video, you can see it at 1:21. http://www.youtube.com/watch?v=YR5-AWcZEWY In my system, the LED is connected to a FDS Interface Card. I could assign a free offset to the LED but I have no idea how I need to write the LUA-code to make it switch on and off three times. I hope you can give me some advice on that. Regards Fritz
Pete Dowson Posted April 23, 2011 Report Posted April 23, 2011 I mean the Master Warning which should flash 3 times when the autopilot is switched off in the A320. Please have a look at this video, you can see it at 1:21. Oh, i don't need to see a video. I've just not heard of it -- I don't know much about Airbuses I'm afraid! In my system, the LED is connected to a FDS Interface Card. I could assign a free offset to the LED but I have no idea how I need to write the LUA-code to make it switch on and off three times. I hope you can give me some advice on that. You can use a bit in the free user area, 0x66C0 - 0x66FF Have you looked at Lua at all, any of the provided examples, for instance, or the many offerings in the User Contributions subforum? I'd rather help YOU solve it rather than simply do it for you, because then you (and others reading this) will understand it and be able to develop other things as and when. In particular, you need to find the A/P Master offset. This is easy enough for the default A/P -- it is 0x07BC which will change from being non-zero to zero when you switch it off. But if you are using an add-on aircraft with its own A/P it might not be easy to determine the A?P going off. If it is the default A/P you'd use the "event.offset" function to detect when it changed. This would call a function where you'd test the result (the "value" provided) for zero (e.g. "if val == 0 then ..."), and if so set the bit in your chosen LED offset so it lights, then sleep a while, using ipc.sleep(number of milliseconds), then clear the bit, sleep a while, set the bit, sleep a while, clear the bit, sleep a while, ... for the number of flashes you want. Adjust the sleep times for the flash length and gap length you want. You'd set and clear the bit using the ipc.setbits and ipc.clearbits functions. Finally, you'd save the resulting Lua file into the FS Modules folder as "ipcReady.lua"so it starts running when FS is ready to fly. Or if it's only for a particular aircraft you'd name it something else and put its name into the FSUIPC INI file in an [Auto ...] section bearing the aircraft's name or a Profile name, if you are using profiles. I'll answer questions and help you make it work, but I won't write it for you (though i see I nearly did! ;-) ). Regards Pete
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now