Ok, first of all thanks.
This was part of code.... there is more. First is BUTTON command which activate timer. Then comes the rest of code.... then timer = 0 and again just turn the timer on without pressing button. Here is complete code with button command and corrections:
TRISA = $FF
TRISB = $00
B0 var byte
symbol t1 = porta.1
symbol timer = portb.0
symbol relay = porta.0
begin:
pause 100
IF timer = 1 AND relay = 1 THEN
pause 500
timer = 0 'turn off timer'
PAUSE 1000
portb.1 = 0
timer = 1 'turn on timer'
ENDIF
IF timer = 1 AND relay = 1 THEN
pause 500
timer = 0 'turn off timer'
pause 1000
portb.1 = 1
pause 1000
timer = 1 'turn on timer'
ENDIF
B0 = 0
button t1,0,255,0,B0,1,step 'if button is pressed, go to step'
pause 50
goto begin
step:
timer = 1
goto begin
End
This still do the same. Any help now?
Bookmarks