pulsin again!anyone plz help!


Closed Thread
Results 1 to 36 of 36

Hybrid View

  1. #1
    Join Date
    Mar 2011
    Posts
    30


    Did you find this post helpful? Yes | No

    Default Re: pulsin again!anyone plz help!

    np.you had me thinking there for a moment
    but my problem is the same just a pulse spike of 5 volts on button press i want to keep it permantently off or on when io press the button only once...

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: pulsin again!anyone plz help!

    Quote Originally Posted by engineer7 View Post
    ...but my problem is the same just a pulse spike of 5 volts on button press...
    I'm not very familiar with AND/OR and masks yet, but I wouldn't be surprised if your program did just what you told it to do.

    IF TMP>=500 says to turn on during pulse and then off as soon as pulse stops.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

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


    Did you find this post helpful? Yes | No

    Default Re: pulsin again!anyone plz help!

    if tmp >= 500 then
    Will never be as tmp is BYTE size
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: pulsin again!anyone plz help!

    Every iteration of your loop turns the led off right after start. There's you problem.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  5. #5
    Join Date
    Mar 2011
    Posts
    30


    Did you find this post helpful? Yes | No

    Default Re: pulsin again!anyone plz help!

    thanks for reply everyone..
    @demon and mackaraket guys the above code is working there is nth wrong with it.i just want to add an additional functionality of on/off...

    @cncmachineguy i didnt understand your reply can u elaborate a little.... plz
    Last edited by engineer7; - 5th June 2011 at 13:05.

  6. #6
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: pulsin again!anyone plz help!

    Code:
    Start:
    LOW SONYLED <-------------------------Here you turn off the LED
    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 <=9 then
    loop:              
    toggle Sonyled '<----------------------change! 
     
    endif
    pause 100
    goto start  <--------sends program back to the beginning, this will turn off the LED
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: pulsin again!anyone plz help!

    Quote Originally Posted by mackrackit View Post
    if tmp >= 500 then
    Will never be as tmp is BYTE size
    Very good, a byte can count from 0 to 255.

    That could give unpredictable results (except for the gurus that can most likely figure exactly how it will go screwy ); it may work, it may not.

  8. #8
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: pulsin again!anyone plz help!

    @ Demon, I do not at all to be a guru who could figure out how it will go screwy, I am fairly certain IRBUTTON is ALWAYS = 0 after his for loop. Since there is NO way to cram a number bigger then %11111111,$FF,255 in a byte, it will always do the else setting all 11 bits to zero.

    So I would certainly question the OP's statement that it works, I think it prolly does in fact receive the signal, and detect the header. but I think from there it will fail as soon as it is tested for specific button presses.

    We shall wait and see
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  9. #9
    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

  10. #10
    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...

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