Hi.. Looking for a bit of help … Again :-)

I have a temperature monitoring design all working fine but I am attempting to filter a low temp alarm (A little like a hysteresis window). In my case "temp" has to be <=2 degrees for 5 seconds before I jump to the alarm label.

At moment as soon as it sees 2degrees alarm condition.

My Code:-

START:

IF temp <2 THEN
FOR COUNTBYTE = 0 TO 9
PAUSE 500
IF temp >2 THEN START
NEXT COUNTBYTE
GOTO ALARM
END IF

I am assuming that if I sample and act 10 x 500ms this will do as I think….

As usual comments / help advice welcome

Thank you for reading

Andy