IR problems


Results 1 to 11 of 11

Thread: IR problems

Threaded View

  1. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Here is one I am using for a "Laser Fence". It will also work for IR.

    And the simple code to go with it.
    Code:
    DEFINE OSC 4
    
    Asm
        ERRORLEVEL -306
    Endasm
    
    include "modedefs.bas"
    
    ANSEL=%00000000
    CMCON=7
    
    PAUSE 2000
    
    TRAIN	VAR BYTE
    
    TRAIN=$55
    CNT	VAR BYTE
    LP	VAR BYTE
    
    START:
    COUNT PORTC.1,100,LP
    IF LP <> 1 THEN CHECK
    HIGH PORTC.5
    PAUSE 50
    LOW PORTC.5
    PAUSE 50
    GOTO START
    
    CHECK:
    COUNT PORTC.1,100,LP
    IF LP <> 1 THEN BREACH
    GOTO START
    
    BREACH:
    FOR CNT = 1 TO 5
    SEROUT PORTC.4,T2400,[TRAIN,TRAIN,TRAIN,TRAIN,TRAIN,9,3]
    HIGH PORTC.5
    PAUSE 100
    NEXT
    GOTO START
    
    END
    R2 will adjust the sensitivity of the Photo Diode. Ambient light does need to be shielded. Have used the same with IR but R2 was a fixed 10meg. (Total darkness for a parts counter on a conveyor)

    Using 3 volts because of the radio transmitter.
    Attached Images Attached Images  
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Replies: 17
    Last Post: - 12th April 2014, 02:17
  2. Having problems with IR Remote circuit.........
    By sanddune008 in forum General
    Replies: 1
    Last Post: - 19th November 2008, 12:02
  3. Plz help in completing RC-5 IR remote lamp dimmer project
    By vu2iia in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd April 2008, 08:44
  4. PIC10F200 Automated IR Light Switch
    By Bruce in forum Code Examples
    Replies: 7
    Last Post: - 3rd May 2007, 11:40
  5. how to get pic to pic communication
    By kinsiro in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th August 2005, 17:12

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