pulsin again!anyone plz help!


Closed Thread
Results 1 to 36 of 36

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Posts
    78


    Did you find this post helpful? Yes | No

    Default Re: pulsin again!anyone plz help!

    without to check your code i think you should consider the frames (codes) of the ir Sony protocol... because Sony remotes all appear to repeat each frame a minimum of 3 times...and also i think you toggle the led by pressing too long time the button on the remote ..... add some some long pause for test

  2. #2
    Join Date
    Mar 2011
    Posts
    30


    Did you find this post helpful? Yes | No

    Default Re: pulsin again!anyone plz help!

    @cncmachineguy thanx a lot for pointing me the problem.i ve been a fool n i admit... the toggle function works fine... thanx v much again your approach has been dead on...g8 advice for beginners!!
    @demon u r right as well.the code is working for all the buttons of my remote(unexpected results)... not for just button <9 .problem wid temp most probably... i'll declare it a WORD n c how it goes...!

    @bogden thanks for your input as well. i have put a delay of 100...

  3. #3
    Join Date
    Mar 2011
    Posts
    30


    Did you find this post helpful? Yes | No

    Default Re: pulsin again!anyone plz help!

    my final code it is toggling on button 6 of your sony remote.n the good thing is no interrupts or timers simple code


    Code:
     
    @ DEVICE pic16F877a, WDT_OFF  ' Watchdog Timer
    @ DEVICE pic16F877a, PWRT_OFF  ' Power-On Timer
    @ DEVICE pic16F877a, BOD_OFF  ' Brown-Out Detect
    @ DEVICE pic16F877a, LVP_OFF  ' Low-Voltage Programming
    @ DEVICE pic16F877a, CPD_OFF  ' Data Memory Code Protect
    @ DEVICE pic16F877a, PROTECT_OFF ' Program Code Protection
    @ DEVICE pic16F877a, HS_OSC  
     
    Define OSC 20 
    cmcon=2
    Header var word
    Body var word
    i var byte
    tmp var word
    irButton var byte
    irDevice var byte 
    irIN var PortB.2 
     
    SonyLED var PortB.5 
     
    TrisB = %00000100 
    Start:
    'LOW SONYLED 
    IRBUTTON=255: IRDEVICE=255
     
    Pulsin irin,0,header 
    if header < 1000 or header > 1350 then goto Start
     
    check: 
    for i =0 to 11
    pulsin irin,0,tmp 
    if tmp >= 500 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
     
    if IRBUTTON=5  then
    loop:
    toggle Sonyled
     
    endif
    pause 100
    goto start

    copy/paste n njoy love PBP!!!!

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default Re: pulsin again!anyone plz help!

    Insignificant, but I would change this:

    Code:
    if IRBUTTON=5  then
    loop:
    toggle Sonyled
     
    endif

    To this:

    Code:
    if IRBUTTON=5  then toggle Sonyled

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