Thanks Pete.
Actually maybe I could ask for some more help (anyone?)?
I wrote the following which does what I want (apply brakes when on ground). I can see the brakes values increasing by watching the offsets outputted to the screen display. I set up the axis assignment to call my lua script when a range is entered (8000 to 16383 i.e. when I push the stick forward), and repeat whilst in range. This works sort of OK for the default Trike, but on loading the FSL A320 the values stop updating which means the brakes don't get pressed. I tried it by setting controls, using the default keypress (.) and setting the toe brakes offsets directly to emulate the keypress. The only way I can get FSLA320 brakes to respond is to use the offset method. However this way is like bashing the . key, and setting the offset value to 200 slams the brakes on - is there a different way to code this to more smoothly apply the brakes perhaps?
function press_brake (offset, value)
-- function decides that if the value of offset is 1, then send brake controls
if value == 1 then
-- send left and right brake controls
-- ipc.control(65720)
-- ipc.control(65721)
-- ipc.keypressplus(190,8,1)
ipc.writeUB("0C01",150)
ipc.writeUB("0C00",150)
end
end
-- read the offset value 0366 which is aircraft on ground offset and pass to function
event.offset("0366", "UB", "press_brake")
Thanks