ir decode using pulsin help needed!!!


Results 1 to 6 of 6

Threaded View

  1. #1
    Join Date
    Mar 2011
    Posts
    30

    Default ir decode using pulsin help needed!!!

    here is my code:
    Code:
    '****************************************************************
    '*  Name    : UNTITLED.BAS                                      *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2011 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 5/23/2011                                         *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    Define OSC 20 
    Header var word
    Body var word
    i var byte
    tmp var Byte
    irButton var byte
    irDevice var byte 
    irIN var PortA.2 
    SonyLED var PortB.2 
    
    TrisA = %00000100 
    TrisB = 0 
    Start:
    LOW SONYLED 
    IRBUTTON=255: IRDEVICE=255
    
    Pulsin irin,0,header 
    if header > 1000 or header < 1350 then goto Start
     
    for i =0 to 11
    pulsin irin,0,tmp 
    if tmp >= 480 then
    Body.0[i]=1 'Sony Logic 1 is 120
    else
    Body.0[i]=0 ' Sony Logic 0 is 60
    endif
    next
    IRBUTTON = Body & %01111111 'Mask 7 bit 
    IRDEVICE = (Body >>7) & %00011111 'Mask 5 bit 
    If IRDEVICE=255 then goto start
     
    if IRBUTTON >=0 and IRBUTTON < 255 then
    high Sonyled
    pause 300
    low Sonyled
    endif
    pause 100
    goto start
    i am using pic16f877a n i am definitely using picbasic pro now.
    but the pin portb.2 never gets high on pushing any button of my sony remote.can anyone plz plz help me out with this.i really need to make it work plz!
    Last edited by Archangel; - 24th May 2011 at 05:17.

Members who have read this thread : 1

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