The Program

 

'18X 14 bit0-15 b0-13 w0-6

'high 1' led for keep alive
'high 2' fan
'high 4' fan led'
'high 0 canera
'high: 3 camera led
high 3:high 0 ' turn on camera
b3=200 'high temp threshold-turn off camera

lop:
high 1
readadc 2,b1 ' read pot
readadc 1,b2 ' read thermistor
readadc 0,b6 ' high temp cutoff
high 7: pause 200:SEROUT 7,t4800,("?f") ' clear the LCD
high 7: pause 200:SEROUT 7,t4800,("?f","pot ",#b1," therm ",#b2)
high 7: pause 200:SEROUT 7,t4800,("?n","high temp cut ",#b6)
if bit1=1 then goto chk
if b2>b1 then gosub fanon
chk:
if b2<b1 then gosub fanoff
low 1:pause 500
if bit2=1 then goto chk1
if b2>b3 then gosub camoff
chk1:
if b2<b3 then gosub camon
if b2>b6 then gosub hitmp
goto lop

hitmp: ' high tmep cutoff
gosub camoff
high 1
pause 500
low 1
pause 500
readadc 0,b6
readadc 1,b2
pause 1
if b2>b6 then goto hitmp
return

fanon:
pause 500:high 2:high 4:return

fanoff:
pause 500:low 2:low 4:return

camoff:
low 0:low 3:return

camon:
high 0:high 3:return