Close, can't monitor during PAUSE 500.
Personally, I'd use a timer in Darrel's instant interrupts to control 5 second lapse.Code:InAlarm var WORD LOOP VAR WORD START: . . ' Tweak 5000 value to take into account ' time to take temp reading. . . InAlarm=0 FOR LOOP= 1 TO 5000 ' Loop 5 seconds ...READ TEMP IF temp <2 THEN InAlarm=InAlarm+1 PAUSE 1 ' Pause 1 millisecond ELSE InAlarm=0 LOOP=5555 'Reset loop ENDIF NEXT LOOP IF InAlarm=5000 THEN ALARM ' Check if InAlarm incremented during entire 5 seconds GOTO START
Robert




Bookmarks