Hi guys,
I am building my own panel based on arduino, and I am interfacing it with FSX/P3D through the latest version of FSUIPC. Most of the controls work, but there are a few key controls that do not work for all aircraft, like PMDG 737NGX, A2A P-51, Vans RV-7.
The offsets I am talking about are 0x0bdc for flaps, 0x0bd0 for spoilers, and 0x0be8 for gear. All of these work for default aircraft, and also some add-on aircraft such as RealAir Scout, C90B, Carenado 208, and so on, but not for the aircraft listed above.
Is this because they use some other means of control? Is there perhaps some other offsets I should use instead? Do I have to go to work more manually and emulate the actual key presses in some way? A simple example from my lua script is included below.
Any help is appreciated.
if string.match(str, "flaps:(%d+)") then state = tonumber(string.match(str, "flaps:(%d+)")) ipc.writeUD(0x0bdc, state) end if string.match(str, "spoilers:(%d+)") then state = tonumber(string.match(str, "spoilers:(%d+)")) ipc.writeUD(0x0bd0, state) end table.insert(commands, {0x0be8, "gear", ipc.writeUD, ipc.readUD, 0, 16383}) for i,v in ipairs(commands) do if string.match (name,v[2]) then ipc.log(v[1]) if string.match (action, "on") then v[3](v[1],v[5]) states [v[1]] =v[5] elseif string.match (action, "off") then v[3](v[1],v[6]) states [v[1]] =v[6] elseif string.match (action, "toggle") then current_value =v[4](v[1]) if current_value ~=v[5] then v[3](v[1],v[5]) elseif current_value ~=v[6] then v[3](v[1],v[6]) end else v[3](v[1], tonumber (action)) states [v[1]] = tonumber (action) end break end end [/CODE]