@ -25,6 +25,19 @@ local vote_counter_max = 20 -- when a vote counter reaches this number (
@@ -25,6 +25,19 @@ local vote_counter_max = 20 -- when a vote counter reaches this number (
localgps_vs_nongps_vote=0-- vote counter for GPS vs NonGPS (-20 = GPS, +20 = NonGPS)
localextnav_vs_opticalflow_vote=0-- vote counter for extnav vs optical flow (-20 = extnav, +20 = opticalflow)
-- play tune on buzzer to alert user to change in active source set
functionplay_source_tune(source)
if(source)then
if(source==0)then
notify:play_tune("L8C")-- one long lower tone
elseif(source==1)then
notify:play_tune("L12DD")-- two fast medium tones
elseif(source==2)then
notify:play_tune("L16FFF")-- three very fast, high tones
end
end
end
-- the main update function
functionupdate()
@ -123,6 +136,7 @@ function update()
@@ -123,6 +136,7 @@ function update()
else
gcs:send_text(0,"Pilot switched but already Source "..string.format("%d",source_prev+1))
end
play_source_tune(source_prev)-- alert user of source whether changed or not
end
-- read auto source switch position from RCx_FUNCTION = 300 (Scripting1)
@ -150,6 +164,7 @@ function update()
@@ -150,6 +164,7 @@ function update()