Also you could use a variable as a hysterisis.

hyst_high var byte
hyst_low var byte

hyst_low=0
hyst_high=0

....
....

if temp >= 80+hyst_high then gosub fan1on ' fan ON at 80
if temp <= 70+hyst_low then gosub fan1off


fan1on:
hyst_high=5
hyst_low=0
...
...
return

fan10ff:
hyst_low=5
hyst_high=0
...
...
return

Ioannis