Je viens d'ajouter un petit bout de code : une temporisation des 2 barrières au repos durant 2 sec. :
else if defaut_barriere=0 and reglage_barriere=1 then '---------- 2 barrieres aux repos apres reglage barriere (s) initialise : NEW
Pensez-vous que cela peut solutionner mon problème ?
else if defaut_barriere=0 and reglage_barriere=1 then '---------- 2 barrieres aux repos apres reglage barriere (s) initialise : NEW
Pensez-vous que cela peut solutionner mon problème ?
Rich (BB code):
chrono:
do
led_defaut=allumee : led_status=eteinte
;================ Appel des memoires
if memoires_temps=0 then
led_status=eteinte
gosub liste_temps
end if
;================ Choix mode de fonctionnement + commande led
if choix_sens=UnVersDeux and choix_nbr=deux then
led_sens=allumee : led_nbr=allumee
hserout LCD,(254,128,"Mode : 1 -> 2 ")
i_start =%00000101 : i_stop =%00000110 'i_ = interruptions
b_stop=%00000010 : b_all=%00000011 'b_ = barrieres : fonctionnalites
else if choix_sens=DeuxVersUn and choix_nbr=deux then
led_sens=eteinte : led_nbr=allumee
hserout LCD,(254,128,"Mode : 2 -> 1 ")
i_start =%00000110 : i_stop =%00000101 'i_ = interruptions
b_stop=%00000001 : b_all=%00000011 'b_ = barrieres : fonctionnalites
else if choix_sens=UnVersDeux and choix_nbr=une then
led_sens=allumee : led_nbr=eteinte
hserout LCD,(254,128,"Mode : 1 seule")
i_start =%00000101 : i_stop =%00000101 'i_ = interruptions
b_stop=%00000001 : b_all=%00000001 'b_ = barrieres : fonctionnalites
else if choix_sens=DeuxVersUn and choix_nbr=une then
led_sens=eteinte : led_nbr=eteinte
hserout LCD,(254,128,"Mode : 2 seule")
i_start =%00000110 : i_stop =%00000110 'i_ = interruptions
b_stop=%00000010 : b_all=%00000010 'b_ = barrieres : fonctionnalites
end if
;================ Verification barriere(s) utilisee(s) active(s) -> affichage 2me ligne
do
defaut_barriere=b_all andnot barrieres
if defaut_barriere>0 then
led_status=allumee
reglage_barriere=1 '---------- reglage barriers (s) initialise
end if
if defaut_barriere=%11 then '---------- 2 barrieres actives
hserout LCD,(254,192,"VERIF BARRIERES ")
pause 4000
led_defaut=eteinte : led_status=eteinte
pause 4000
led_defaut=allumee : led_status=allumee
else if defaut_barriere>0 then '---------- 1 barriere active
hserout LCD,(254,192,"VERIF BARRIERE ", #defaut_barriere)
if defaut_barriere=1 then
pause 4000
led_status=eteinte
pause 4000
led_status=allumee
else
pause 4000
led_defaut=eteinte
pause 4000
led_defaut=allumee
end if
else if defaut_barriere=0 and reglage_barriere=1 then '---------- 2 barrieres aux repos apres reglage barriere (s) initialise : NEW
timer=0 : val_temps=0
do
pause 2000 'controle toute les 1/4 sec.
val_temps=timer
defaut_barriere=b_all andnot barrieres
if defaut_barriere>0 then
val_temps=210
end if
loop until val_temps>200
endif
loop until defaut_barriere=0
led_defaut=allumee : led_status=eteinte : reglage_barriere=0
;================ Affichage dernier temps -> decomposition en ASCII + affichage 2m ligne
bintoascii val_old1, b1,b2,b3,b4,b5
hserout LCD,(254,192,"Memoire ",b1,b2,b3,",",b4,b5," s")
pause 8000
;================================ Boucle attente du START ================
timer=0 : val_temps=0 'RAZ variables
setint or %00000000,i_start,B '---------- interruption : BP Start/Stop ou barriere Start
do { '---------- boucle attente du START