Hi there
i try to set a toggle switch for taxi lights.
I know how to check an complete offset for changes - it´s like that
event.offset("0D0C", "UW", "TaxiLights")
But how can check just the bit which is important for the TaxiLights? (In this case the bit i need to know is :cool:
I think i can read out the value of a bit so that i can decide if a LED has to turn on or off for the next step.
Hope you´ll understand my english
Thanks for your response.
Stefan
EDIT:
Sorry for the question i think i found a workaround.
If you´re interested in it i will post it.
function TaxiLights(offset, value) -- TaxiLights prüfen und LED schalten
gfd.SetBright(GFT8, 0, 12)
TL = logic.And(ipc.readUW(0x0D0C), 8) -- Wert prüfen ob TaxiLight ein oder aus sind
if TL == 1 then
gfd.SetLight(GFT8, 0, 1)
else
gfd.ClearLight(GFT8, 0, 1)
end
end
function SetTaxiLights(model, unit) -- Taxi Lights ein/ausschalten
gfd.GetValues(model, unit)
if gfd.TestButton(1) then -- prüfen ob Hebel für Taxi lights Wert true hat
ipc.clearbitsUW(0X0D0C,8)
else
ipc.setbitsUW(0X0D0C,8)
end
end
event.offset("0D0C", "UW", "TaxiLights") -- Abfrage ob Aktion bei Lichtern
event.gfd(GFT8, 0, "SetTaxiLights") -- Abfrage ob Aktion bei Switches