define osc 4
Digit1 var byte
Digit2 var byte
TrisD = %11110000
TrisA = %01111111
Main:
if PortA.0 = 1 then Count1
else
count2
endif
goto main
END
Count2:
If digit1 > 10 then Deduct
PortD = digit2
Pause 250
Count1:
If Digit1 > 10 then ADd
PortD = Digit1
pause 250
Add:
Digit1 = Digit1 + 1
goto Count1
Is my code, I don't know why whenever i wanna compile it, it says "ELSE without a matching IF .... THEN"
what's wrong with my code?
I use pbp ver2.4
Thanks in advance
Digit1 var byte
Digit2 var byte
TrisD = %11110000
TrisA = %01111111
Main:
if PortA.0 = 1 then Count1
else
count2
endif
goto main
END
Count2:
If digit1 > 10 then Deduct
PortD = digit2
Pause 250
Count1:
If Digit1 > 10 then ADd
PortD = Digit1
pause 250
Add:
Digit1 = Digit1 + 1
goto Count1
Is my code, I don't know why whenever i wanna compile it, it says "ELSE without a matching IF .... THEN"
what's wrong with my code?
I use pbp ver2.4
Thanks in advance