IR detector


Results 1 to 29 of 29

Thread: IR detector

Threaded View

  1. #10
    Join Date
    Aug 2006
    Posts
    91


    Did you find this post helpful? Yes | No

    Default

    Ok last question

    I have read all over about floating points and I still can't figure out how to do this.

    My calculation is

    shotspersecond = count / seconds
    shotsperminute = shotspersecond * 60

    with floating points this would work fine and tell me shots per minute avg.

    Without FP if the seconds > count then I get 0 as shotspersecond and a number of other problems.

    I know this can't be too hard but I can't seem to wrap my brain around it.


    Any help would be very appriciated as once I get this I should be able to finish off my project.

    Any help would be very appriciated as once I get this I should be able to finish off my project.

    This is what I have so far... It may be accurate enough for what I am doing.
    SPS = 5 / TotalTime
    if sps = 0 then
    SPS = 5 // TotalTime
    SPM = sps * 60 / 100
    else
    SPM = SPS * 60
    endif

    Better way to do it?
    Last edited by geckogrotto; - 21st August 2006 at 20:38.

Similar Threads

  1. Replies: 17
    Last Post: - 12th April 2014, 02:17
  2. PIC10F200 Automated IR Light Switch
    By Bruce in forum Code Examples
    Replies: 7
    Last Post: - 3rd May 2007, 11:40
  3. Replies: 10
    Last Post: - 16th October 2006, 18:23
  4. how to get pic to pic communication
    By kinsiro in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th August 2005, 17:12
  5. IR for robot on 16F877A
    By Samuel in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 9th April 2005, 20:57

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