IR detector


Closed Thread
Results 1 to 29 of 29

Thread: IR detector

Hybrid View

  1. #1
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    My calculation is

    shotspersecond = count / seconds
    a) Declare your variables as WORDS

    b) Multiply count by something like 100 or 1000. This shifts the decimal place to the right. Pick a multiplier that will keep the result below 65536.

    b) Now, do the divide: shotspersecond = count / seconds.

    c) Display shotspersecond with something like:

    LCDOUT DEC shotspersecond/100, ".",DEC2 shotspersecond//100

    The key is to shift the decimal place prior to the division, then adjust the display to account for the shift.

    For more reading (and a better example of integer math), take a look at These threads from Darrel Taylor:
    Retrieving 32bit Multiply Result
    Retrieving Div32 Remainder
    32-bit Variables and DIV32, Hourmeter 99999.9.

    You might also try a search for integer math.

    HTH,
    Steve

  2. #2
    Join Date
    Aug 2006
    Posts
    91


    Did you find this post helpful? Yes | No

    Default

    Ohhh thanks Steve I was multiplying x 100 after the divide not before thanks I got it now

  3. #3
    Join Date
    Aug 2006
    Posts
    91


    Did you find this post helpful? Yes | No

    Default

    Ok really this time last question. This has more to do with eagle but figured you guys would know.
    I'm trying to find a LCD like the one on page 94 in the manual to use with eagle and I can't seem to find one.

    I downloaded all the LBR files I could find that said LCD on them but still no luck.

  4. #4
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Mat,

    Just select one of the connectors / Pin Headers that suit the number of connections on the LCD. This will allow you to either plug the LCD into your board if you use a suitable pin and header block, or solder wires directly to the pads if the LCD is remote from the board

  5. #5
    Join Date
    Aug 2006
    Posts
    91


    Did you find this post helpful? Yes | No

    Default

    Thanks malc that will work fine.
    For anyone who was interested or helped with the process and wanted to see the end result here is a video.

    http://www.gecko-grotto.com/workshop/lcd_counter.wmv

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