Shop OBEX P1 Docs P2 Docs Learn Events
program that sends remote control signal to another application? — Parallax Forums

program that sends remote control signal to another application?

tascencaotascencao Posts: 11
edited 2006-04-22 01:41 in BASIC Stamp
hi there,

i'm really new to all this and am mostly working in another program called MaxMSP to create an interactive video installation. I'm trying to save a bit of time (only to come back later and understand further develop) with Basic Stamp programming.

Does anyone have a program which sends an output message based from a Sony TV remote control ? I need to press buttons 1-9 on the remote to be interpreted by another program.

Much thanks in advance!

Comments

  • A.C. fishingA.C. fishing Posts: 262
    edited 2006-04-21 20:09
    I don't understand what you want. I don't understand how a program sends an output. I don't think you need this. A good IR receiver can pick up different frequencies. Explain more... Do you want something that will do something when you press a button on a remote?
    Well, I think remotes generate different IR frequencies when different buttons are pressed.
    So get some wires, 220 resistors, 2k resistors, a IR receiver from Radio Shack, a BS2, and a BOE, and a serial cable/ usb cable. I don't really understand what you need. If you want to display graphics on a TV, then maybe a propellor.
    I think you are trying to make this, but correct me if i'm wrong.
    You hit a button from 1-10 on a remote.
    It sends out an IR frequency, and a receiver connected to a BS2 gets it, determines the frequency, and depending on the frequency, sends information up a serial/USB cable so your MAXMSP can interpret it. Make sure your MAXMSP can read serial input.
    Please tell more for further instructions,
    ACfishing
  • tascencaotascencao Posts: 11
    edited 2006-04-21 20:24
    Hi ACfishing,

    Thanks so much for your response. I'm sounding incoherent because I'm still learning. Thanks for your patience.

    What you said: "It sends out an IR frequency, and a receiver connected to a BS2 gets it, determines the frequency, and depending on the frequency, sends information up a serial/USB cable so your MAXMSP can interpret it" is exactly it.

    I'm going to use a remote control to change video clips in an interactive video projection which uses MaxMSP to interpret incoming remote control button presses. For example, when someone presses button 3 on the remote control a particular video clip will play, or when button 9 is pressed another clip will play etc. I'll eventually also get the video to speed up, slow down etc, but that will come when I figure out the simpler stuff.

    I guess I'm looking for a Basic Stamp program which I could modify to send signals to MaxMSP. I'm thinking there might be someone who might have designed a Basic Stamp program which sends messages depending on what remote control button was pressed (1-9 for now). I already decoded a Sony tv remote control's PWM messages into decimal value.

    Thank you,
    Teresa
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-04-21 20:31
    Hmm. No, A.C., that's not how TV IR remotes work.

    TV IR remotes work by putting out a series of bits. Each 'one' bit is sent by an IR-LED being pulsed at a 38 Khz rate (or 40 Khz, in the case of the Sony.· Doesn't matter, though). Each 'zero' bit is the IR-LED not being pulsed. Sometimes a 'one' bit is a certain length signal -- 1.2 mSec uSec, while a 'zero' bit is a different length signal -- 600 uSec.

    Now, each vendor has their own pattern of pulses. I belive the Sony pattern is one of the more easily generated and/or recieved. To recieve the pattern takes an "IR-Decoder" device, a little three-pin active device which outputs a 'low' when it gets the 38 Khz blinking IR, and outputs a 'high' when it doesn't see it. You can use PULSIN to recieve these signals on the BS2.

    I believe a good picture of the Sony protocol is at: http://users.pandora.be/davshomepage/sony.htm (where you're looking at the output of the Decoder)

    A description is at: http://www.xs4all.nl/~sbp/knowledge/ir/sirc.htm

    And again at: http://www.geocities.com/CapeCanaveral/Launchpad/4652/sircs.htm

    If you assume the 'silent' periods are always 600 uSec (so you don't have to measure them), then with PULSIN statements you should be able to 'decode' the one and zero bits.

    Sending them is more problematic, as it takes about 500 uSec for a stock BS2 to execute a command.

    Post Edited (allanlane5) : 4/21/2006 8:34:10 PM GMT
  • Eric REric R Posts: 225
    edited 2006-04-21 21:30
    Download the PDF from parallax on this page below. It will work with most any universal remote that you can program a Sony code into.

    http://www.parallax.com/detail.asp?product_id=020-00001

    I think this is what you are looking for. This will allow the basic stamp to receive a signal from a universal remote. I just set one up a couple weeks back and it worked better than I thought.·I picked code 002 and it worked the first time.


    Post Edited (Eric R) : 4/21/2006 9:35:29 PM GMT
  • SSteveSSteve Posts: 808
    edited 2006-04-21 21:34
    Teresa:

    Download the Understanding Signals book. It has a chapter on interpreting Sony IR commands. It approaches it from the point of view of looking at the signals with an oscilloscope, but even without one you should be fine.

    As far as sending signals to MaxMSP via USB, is there already a communications protocol that it's looking for or are you rolling your own?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-04-21 22:15
    Excellent! So, that takes care of the 'control your BS2 with an IR-Remote' portion.

    Now, if only you can hard-wire your BS2 to control the other device in some way...
  • A.C. fishingA.C. fishing Posts: 262
    edited 2006-04-21 23:04
    the BS2 can send information to a computer using the serout and serin commands. You just need to attach a serial cable. But, can your MAX program read serial?
  • tascencaotascencao Posts: 11
    edited 2006-04-21 23:38
    Wow! thanks so much for all the info. Didn't expect so much in so little time. Hopefully I will be able to help others one day too - one day faaaaaaaar down [noparse]:)[/noparse]

    Allan and Eric, I'm ok with the TV IR signals. I already went through this part of the process, but those links are wonderful and I will look at them for better knowledge.

    AC, About MaxMSP communicating with serial, well, I might have a problem as I'm using a Parallax BOE with USB connection. I will see if that matters in using the serin and serout commands. As I don't have my own protocol, that's what I'm looking for... a Basic Stamp program which sends my (already decoded) remote control signals to MaxMSP.

    Thanks again and hope we don't all stay in on a Friday night!
    Teresa
  • tascencaotascencao Posts: 11
    edited 2006-04-21 23:45
    i actually just found this and will look through for a possible BS2 program to talk to MaxMSP. In case this helps anyone else with the same...

    http://interactive.usc.edu/members/phoberman/CTIN544/

    teresa
  • SSteveSSteve Posts: 808
    edited 2006-04-22 00:02
    Are you running MaxMSP on OS X or Windows?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows
  • tascencaotascencao Posts: 11
    edited 2006-04-22 00:24
    osx

    t
  • SSteveSSteve Posts: 808
    edited 2006-04-22 00:47
    Then you should be able to communicate through USB. I haven't used MaxMSP, but I can communicate with the Stamp through Kermit. (It also lets you use DEBUGIN, which isn't possible with MacBS2. You can get Kermit from http://www.columbia.edu/kermit/ck80.html.)

    If you go into Terminal and look in the /dev directory, you'll see something like "tty.usbserial-xxxxxxxx". That will be the serial port you want to use.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows
  • tascencaotascencao Posts: 11
    edited 2006-04-22 00:53
    thanks steve, i will check out kermit and see if it works for interactive video. i'm still hoping to use maxmsp as i've already started with a program.

    t
  • SSteveSSteve Posts: 808
    edited 2006-04-22 01:04
    Kermit is a simple terminal emulator. I mentioned it just as an example of communicating to the Stamp over USB.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows
  • tascencaotascencao Posts: 11
    edited 2006-04-22 01:41
    sure, i'll take a look. in the meantime, if you know of any kermit source code which communicates ir signals to maxmsp i could start out with, please let me know.

    t
Sign In or Register to comment.