MrDEB
Well-Known Member
Have tried using ELSE ETC. but the REPEAT UNTIL loop stops when I input time4. The time 1 to time3 work. WHY?? I thought REPEAT should keep looping UNTIL master_swt = 0.
Code:
SUB ET () // rotary switch selects the desired delay elapsed time between 1st green and red led.
//player selects the desired elapsed time of play then presses the red Led switch (Master_swt) to indicate
//selection then code continues
repeat' master_swt=1
mst_led=1
IF Time1=0 //port A.2
THEN Et_time=1000
end if
IF Time2=0 // portA.3
THEN Et_time=1500
End if
IF Time3=0 //portA.4
THEN Et_time=2000
End if
IF Time4=0 //portA.5
THEN Et_time=2500
end if
Green1=0 //500ms time1
DELAYMS(Et_time) //5000ms time3
TOGGLE(Green1)
Green2=0 //500ms time1
DELAYMS(Et_time) //5000ms time3
TOGGLE(Green2)
Yellow1=0 //3500ms time1
DELAYMS(Et_time) //5000ms time3
TOGGLE(Yellow1)
Yellow2=0 //500ms time1
DELAYMS(Et_time) //5000ms time3
TOGGLE(Yellow2)
MST_LED=1
DELAYMS(1000)
MST_LED = 0
DELAYMS(1500)
UNTIL Master_Swt=0 //exit routine
'wend
END SUB
[/QUOTE]