Hi
I wrote a simple basic program for my PIC (12c508A) in a Picbasic Pro compiler
but I have this error after compilation "unable to fit variable soft_stack"
please see my program below and tell me the errors as I am beginner in PIC programming .
Thanks
lowinput VAR GPIO.0
overtemprature VAR GPIO.1
overload VAR GPIO.2
outputpin VAR GPIO.3
green VAR GPIO.4
red VAR GPIO.5
count1 var byte
i var byte
OUTPUT outputpin
input lowinput
input overtemprature
input overload
OUTPUT green
OUTPUT red
while i=0
if (lowinput=0) and (overload=0) and (overtemprature=0) then
outputpin =0
High green
Pause 500
Low green
Pause 500
ENDIF
if (lowinput=0) and (overload=1) and (overtemprature=0) then
while count1<2
gosub overloadmode
count1=count1+1
wend
outputpin =1
while count1<7
gosub overloadmode
count1=count1+1
wend
outputpin =0
count1=0
ENDIF
if (lowinput=1) and (overload=0) and (overtemprature=0) then
while count1<5
gosub lowinputmode
count1=count1+1
wend
outputpin =1
count1=0
ENDIF
if (lowinput=0) and (overload=0) and (overtemprature=1) then
while count1<5
gosub overtempraturemode
count1=count1+1
wend
outputpin =1
count1=0
ENDIF
if (lowinput=1) and (overload=1) and (overtemprature=0) then
while count1<5
gosub overtempraturemode
count1=count1+1
wend
outputpin =1
count1=0
endif
wend
overloadmode:
High green
low red
Pause 500
Low green
high red
Pause 500
return
lowinputmode:
High green
low red
Pause 500
Low green
high red
Pause 500
return
overtempraturemode:
High green
high red
Pause 500
Low green
low red
Pause 500
return
end
Bookmarks