Valid data checking help please… Hysteresis Question ?


Results 1 to 10 of 10

Threaded View

  1. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Valid data checking help please… Hysteresis Question ?

    Close, can't monitor during PAUSE 500.

    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
    Personally, I'd use a timer in Darrel's instant interrupts to control 5 second lapse.

    Robert
    Last edited by Demon; - 24th July 2014 at 00:26. Reason: GOTO out of Code section, missing pause 1, comments

Similar Threads

  1. Is this a valid statement?
    By dbachman in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 9th February 2017, 18:34
  2. hysteresis control
    By hyeniyurt in forum Off Topic
    Replies: 0
    Last Post: - 25th February 2009, 22:37
  3. Hysteresis.. How to do it??
    By hoopstar in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th March 2007, 00:35
  4. help with error checking GPS data over audio link
    By MUC in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 21st February 2005, 20:23
  5. Long Delays - Is there a valid way?
    By rad in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 29th December 2003, 10:52

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts