Life after 2k w/ 16F648


Results 1 to 15 of 15

Threaded View

  1. #8
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Ace,
    >>>
    Ace
    For I = 1 to 16....

    GOSUB Thesub
    PULSIN input,1, value

    IF (value < A) OR ( value > B ) then

    error = 1 ( it's a red led ! )
    value1 = ...
    value2 = ...
    GOTO Start

    ENDIF

    result = result + value

    NEXT I

    result = result >> 4 ( the mean value ....)
    <<<<

    REwrite it as the following:; I think this will solve your problem...This is assuming you have a goto start BEFORE your subroutine...like after your
    result = result >> 4 ( the mean value ....) statement.


    i=1
    while(i<17)

    GOSUB Thesub
    PULSIN input,1, value

    IF (value < A) OR ( value > B ) then

    error = 1 ( it's a red led ! )
    value1 = ...
    value2 = ...
    i=18
    else
    result = result + value
    endif
    I=I+1
    endwhile
    if I>18 then goto start

    result = result >> 4 ( the mean value ....)
    Last edited by Dwayne; - 23rd June 2005 at 20:36.
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

Similar Threads

  1. Worst day of my life
    By brid0030 in forum USB
    Replies: 6
    Last Post: - 12th March 2008, 22:27
  2. EEPROM life expectancy?
    By muddy0409 in forum General
    Replies: 3
    Last Post: - 1st May 2007, 12:44
  3. Replies: 5
    Last Post: - 11th February 2007, 23:55
  4. Any chance of Life being easy?
    By josegamez in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd November 2006, 20:52
  5. above 2k with 16F877
    By Peter Oors in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th March 2006, 12:43

Members who have read this thread : 0

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

Posting Permissions

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