'BASIC converted from flowchart: 
'C:\Users\AndreBernot\Documents\Mes documents A4\00000-Travail en cours\Cyberbotics-Webots\Programmes APOR-COUL\Programmes p?dagogie Portail coulissant\Portail coulissant 7-5.cad
'Converted on 15/04/2013 at 17:41:19

symbol SigLum = 0
symbol EBIR_ext = 1
symbol LCD = 3
symbol MOTA2 = 6
symbol MOTA1 = 7
symbol BP_int = pinC.0
symbol FDC_D = pinC.1
symbol FDC_G = pinC.2
symbol BP_ext = pinC.3
symbol RIR_ext = pinC.4

main:
label_E7:   if BP_ext=1 then label_F4
		if BP_int=1 then label_F4
		goto label_E7

label_F4:   gosub LCD1
		high EBIR_ext
label_9:    high SigLum
label_8D:   gosub ouverture
label_37:   if FDC_D=1 then label_10
		if RIR_ext=1 then label_1E8
		goto label_8D

label_10:   low SigLum
		gosub Arret
		gosub LCD3
label_2C:   if BP_ext=1 then label_10C
		if BP_int=1 then label_10C
		goto label_2C

label_10C:  gosub LCD2
		high SigLum
label_96:   gosub fermeture
		if FDC_G=1 then label_25
		if RIR_ext=1 then label_9
		goto label_96


label_25:   low SigLum
		gosub Arret
		gosub LCD3
		goto label_E7

label_1E8:  gosub Arret
label_1F1:  if RIR_ext=1 then label_1FC
		goto label_1F1

label_1FC:  wait 3
		gosub ouverture
		goto label_37

ouverture:	
		toggle SigLum
		pause 100
		high MOTA1
		low MOTA2
		return

fermeture:	
		toggle SigLum
		pause 100
label_1E:   high MOTA2
		low MOTA1
		return

Arret:	
		low MOTA1
		low MOTA2
		return

LCD1:	
		pause 100
		serout LCD,N2400,(254,1)
		pause 10
		serout LCD,N2400,("Ouverture du")
		serout LCD,N2400,(254,192,"portail")
		return

LCD2:	
		pause 100
		serout LCD,N2400,(254,1)
		pause 10
		serout LCD,N2400,("Fermeture du")
		serout LCD,N2400,(254,192,"portail")
		return

LCD3:	
		pause 100
		serout LCD,N2400,(254,1)
		pause 10
		serout LCD,N2400,("Portail en")
		serout LCD,N2400,(254,192,"Attente")
		return


