IR Remote

I have learned to use the ir remote control to write keys to the debug terminal. I need help choosing a key on the remote and using that choice to activate a remote device, such as a transistor. As you can see, I'm a willing student.

Thanks,

Flasher

Comments

  • 7 Comments sorted by Date Added Votes
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    If you post the code you're using to display keys on the DEBUG screen we can show you how to make adjustments to take some other action. Please use the code tags when posting or attach your code to your reply.
    Chris Savage | Engineering Tech | Main Office: (916) 624-8333 | Direct to Tech Support: (888) 997-8267 | Website | Twitter | Google+
  • I am using the code associated with the IrRemotecodeCapture.bs2.
    My object is to punch in a number and use the output from the remote to control a circuit remotely.

    Thanks,

    Flasher
  • There's an example starting on PDF page 83 (print page 73).

    https://www.parallax.com/downloads/ir-remote-boe-bot-text
  • Congrats, flasher, you stand on the brink of as whole new world. I still remember when I got my BS2 to respond to an IR remote. It was magic then, and I still think it's a great way to control a project. The world has gone mad for Bluetooth and WiFi, but a simple IR remote is just as powerful IMO.

    Now that you have your program reading the remote and debugging, start adding IF checks within your loop to branch to a program segment or subroutine that does what you want. Pseudo code:
    main:
    
    <insert routine for reading IR, store value as variable B0>
    
    IF B0=20 THEN aaa  ' if MUTE button, go to label aaa
    IF B0=21 THEN bbb ' if POWER button, goto label bbb
    goto main
    
    aaa:              ' label aaa, comes here if mute button pressed
    HIGH 1         ' make pin1 high (on)
    GOTO main  ' go back to main loop
    
    bbb:             ' label bbb, comes here if power button pressed
    LOW 1          ' make pin1 low (off)  
    GOTO main  ' go back to main loop
    
    "When you make a thing, a thing that is new, it is so complicated making it that it is bound to be ugly. But those that make it after you, they don’t have to worry about making it. And they can make it pretty, and so everybody can like it when others make it after you."

    - Pablo Picasso
  • Thanks, ERCO. My first project using the IR Remote was to trigger a transistor in a circuit located in a bird feeder in the front yard. The transistor would operate a relay. On down the chain to cause a servo to release a golf ball suspended on a string. The golf ball swings like Tarzan and slams against the bird feeder and scares away the squirrel.
  • Cool! How do you retract the golf ball?
    San Mateo, CA
  • ercoerco Posts: 17,696
    Fantastic! You got much farther than this fellow, demonstrating "IR Support". :)


    "When you make a thing, a thing that is new, it is so complicated making it that it is bound to be ugly. But those that make it after you, they don’t have to worry about making it. And they can make it pretty, and so everybody can like it when others make it after you."

    - Pablo Picasso
Sign In or Register to comment.