
- Code: Tout sélectionner
-----------------------------------------------------------------------------------------------------
-- SECTION A ADAPTER SELON LES BESOINS
-----------------------------------------------------------------------------------------------------
-- Load sounds
mysound1 = sound_add("mysound1.wav")
function stop_sound()
sound_stop(mysound1)
end
function new_altitude(batt,alt)
-- Condition pour laquelle le voyant s'allume
-- a modifier suivant le besoin
if alt<1000 and battery_on==true and light_on==false then
light_on=true
-- Play the sound
sound_loop(mysound1)
timer_start(1500,nil,stop_sound)
--print("light_on")
else
light_on=false
--print("light_off")
end
-----------------------------------------------------------------------------------------------------
--
-----------------------------------------------------------------------------------------------------
Il faut copier le fichier mysound1.wav dans le dossier « resources » de la jauge
Jacques