Shop OBEX P1 Docs P2 Docs Learn Events
ir remote — Parallax Forums

ir remote

SpeakerSpeaker Posts: 34
edited 2009-05-08 22:38 in BASIC Stamp
The 'Decode IR Remote' program is a starting point, but how do I make a program see when the button on a remote has been released?

Comments

  • ZootZoot Posts: 2,227
    edited 2009-05-08 21:16
    If there is no new incoming data (IR sensor is not being pulled low), then it's done. You could put in a simple counter and check, a la:

    ' parse incoming IR message
    ' then....
    
    Start_Wait:
       cntr = 0
    Wait_Here:
       IF irDetector = 1 THEN
          cntr = cntr + 1
          IF cntr > 50 THEN Released ' you may need to play with this value
          GOTO Wait_Here
       ELSE
          GOTO Start_Wait
       ENDIF    
    Released:
      ' and onward...
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • SpeakerSpeaker Posts: 34
    edited 2009-05-08 22:38
    Thanks.· I had the basic idea, but my implementation was clunky and was causing difficulties.· This is more elegant.
Sign In or Register to comment.