fix ThrottleInit (1)

This commit is contained in:
2026-06-25 06:20:15 -05:00
parent 87847cc621
commit 1f487a98c4

View File

@@ -117,6 +117,21 @@ Config.Autopilot = {
AutopilotDesiredHeading = nil
}
Throttles = {
ForeThrottle = {
name = nil,
side = nil
},
AftThrottle = {
name = nil,
side = nil
},
DownThrottle = {
name = nil,
side = nil
}
}
function ThrottleInit()
local sides = {
"top",
@@ -171,6 +186,46 @@ function ThrottleInit()
end
end
end
print("\nIdentifying aft throttle")
print("\nPlease change the input signal for the throttle")
local initialStates = getRelayStates()
while true do
local currentStates = getRelayStates()
for pname, currentState in pairs(currentStates) do
local initialState = initialStates[pname]
for k, v in pairs(currentState) do
if initialState[k] ~= v then
Throttles.AftThrottleThrottle.name = pname
Throttles.AftThrottle.side = k
return
end
end
end
end
print("\nIdentifying down throttle")
print("\nPlease change the input signal for the throttle")
local initialStates = getRelayStates()
while true do
local currentStates = getRelayStates()
for pname, currentState in pairs(currentStates) do
local initialState = initialStates[pname]
for k, v in pairs(currentState) do
if initialState[k] ~= v then
Throttles.DownThrottle.name = pname
Throttles.DownThrottle.side = k
return
end
end
end
end
end
function PropellerInit()