Best way or ways?


Results 1 to 10 of 10

Threaded View

  1. #9
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Best way or ways?

    Usually for counting pulses in time, such as speedometers/tachometers or the like,
    you can either go for counting the number of pulses that occur over a constant defined duration,
    or timing the space between each individual pulse with an interrupt.

    The former is easier to implement from a BASIC point of view,
    but when it gets to something like counting the number of pulses from your
    transmission in one second, and calculating speed on that,
    you end up with a display that can only be updated once per second,
    and might find there aren't enough pulses to increase it's resolution.

    There are some tricks to improve it such as using multiple intervals that
    overlap each other, so a single pulse count might apply to a calculation
    for multiple time intervals.

    The former method, calculating based on the duration between each pulse
    is more prone to error in some situations such as a heart rate monitor
    where the hardware might throw in random pulses because our interface
    to the Human heart isn't good, and although I haven't used one,
    it sounds like a problem you might face with your sensor.

    In that case I had the program look at a number of the previous times,
    so that it could either average them out, or disqualify silly looking readings.
    I was happy with that, although for a speedometer, it would mean that if
    you crash it into a wall, the speedo would drop to zero over a number of readings.

    I would be worried about the projects influence on the performance of the vessel,
    but since you're the one doing it, I'm sure you've taken it into consideration.
    Last edited by Art; - 31st July 2013 at 07:15.

Similar Threads

  1. Ways to make code easily reviewable and extendable
    By Ted's in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 23rd August 2008, 00:10
  2. Showing numbers in diffrent ways?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 29th July 2005, 15:57
  3. PIC problem, ways to do reset
    By lab310 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th May 2005, 14:31

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