IF Temperature > alarmhigh then AlarmPin = 1
IF Temperature < alarmlow then AlarmPin = 1
Malcom, you have a typo in your two lines of code!

Al.