Hi guys,
as the title says, I am trying to do some interfacing. Using the dataref tool, I found that pressing a button within X-Plane sets the dataref from 0 to 1, releasing the button sets it back to 0. I can manually change the value of the dataref and this is working fine. However, when trying to do the same thing in LUA, I'll get several characters displayed on the CDU (like "AAAAA" instead of "A").
I see some people already interfaced the CDU for their private sim or as commercial software, but I wonder how this was done?
Example code, which prints "BBBB" one second after clicking the "B" button:
function b_pressed()
xpl_dataref_write ("ixeg/733/FMC/cdu1_B", "FLOAT", 1)
timer_start(1000,timer_b)
end
function timer_b()
xpl_dataref_write ("ixeg/733/FMC/cdu1_B", "FLOAT", 0)
sound_play(clicksound)
print ("B pressed")
end
Can anyone help?