- One button reported as gamepad button - One LED controlable via application specific HID report and FlyWithLua
21 lines
519 B
Lua
21 lines
519 B
Lua
device = hid_open(0x1209, 1)
|
|
|
|
if device == nil then
|
|
print("No device!")
|
|
else
|
|
dataref("low_vac", "sim/cockpit2/annunciators/low_vacuum", "readable")
|
|
local prev_low_vac
|
|
function low_vac_indicator()
|
|
if low_vac ~= prev_low_vac then
|
|
if low_vac > 0 then
|
|
hid_write(device, 2, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
|
else
|
|
hid_write(device, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
|
end
|
|
prev_low_vac = low_vac
|
|
end
|
|
end
|
|
|
|
do_every_frame("low_vac_indicator()")
|
|
end
|