Shop OBEX P1 Docs P2 Docs Learn Events
Need alittle help w/ the IRremoteAppKit(well, a sorta AppKit) — Parallax Forums

Need alittle help w/ the IRremoteAppKit(well, a sorta AppKit)

DiablodeMorteDiablodeMorte Posts: 238
edited 2007-07-08 05:46 in BASIC Stamp
First off, let me praise the mighty parallax gods, yet another beautiful and useful product: the IRremoteAppKit. I got a chance to use this last week @ a robotics thing I attended. It was very easy to get the boebot up and moving with this handy little kit. Sadly as with many things in the real world, I wasn't allowed to take the appkit with me when the confrence ended cry.gif . Anyways, I was fiddling with my boe today and i thought: wouldn't it be cool to just build my own version of the kit? So I did, I grabbed one of the IR recievers that came with the boe bot, a resistor, and I went and found an sony controller. I hooked it up and ran the test code(the first one in: http://www.parallax.com/dl/docs/prod/compshop/IRremoteAppKit.pdf). The code seemed to work, it does detect key presses but this is where things start to go askew. The code only seems to detect the key presses some of the time, and even then after about 10 seconds it only displays any button press as a "1" or a "2". No matter what button I press I only get a "1" or a "2", sometimes the code does flash the correct button code but that is rare.

Any suggestions from the community?
I'm thinking that this controller doesn't output the same way the one in the kit does.

Comments

  • DiablodeMorteDiablodeMorte Posts: 238
    edited 2007-07-02 05:03
    Update:

    I'm now rather convinced that it is a formatting problem w/ my remote. Just for the heck of it i added another check for a bit
    RCTIME IrDet, 0, irPulse
    IF irPulse > ThresholdEdge THEN remoteCode.BIT7 = 1
    

    and the code seems to pick up the right buttons more often, but some of the buttons now are completly screwed up
  • StephenGStephenG Posts: 25
    edited 2007-07-08 05:46
    yeah.gif

    Pulse width modulation can be a little flakey!

    First, there are about a billion (a slight exageration for effect) sets of Sony remote codes.

    Second, be glad you do not have the remote that comes in the ap kit. I am sure it is made in the cheapest prison camps of china! It will perodically de-program itself and be sending God only knows when you press its buttons.

    Third, order of and being careful not to duplicate case selects is important. Listed below are some of the constant definitions I used, some of the vcr constant definitions I did not use and a portion of the CASE ... SELECT DO ... LOOP I used at some point in time to control one of my robots (named Bob) . Please note these codes were consistent with my Sony universal programmable remote but may not be with yours. Sometimes you have to write a little code blurb to read what your IR remote is transmitting and display it with the DEBUG command.

    ' SONY TV IR remote constants for non-keypad buttons

    Enter CON 11
    ChUp CON 16
    ChDn CON 17
    VolUp CON 18
    VolDn CON 19
    Mute CON 20
    Power CON 21
    TvLast CON 59 ' AKA PREV CH

    ' SONY VCR IR remote constants

    ' IMPORTANT: Before you can make use of these constants, you must
    ' also follow the universal remote instructions to set your remote
    ' to control a SONY VCR. Not all remote codes work the same,
    'so you may have to test several.

    VcrStop CON 24
    VcrPause CON 25
    VcrPlay CON 26
    VcrRewind CON 27
    VcrFastForward CON 28
    VcrRecord CON 29

    ' Function keys

    FnSleep CON 54
    FnMenu CON 96

    '
    [noparse][[/noparse] Main Routine ]

    ' Replace this button testing DO...LOOP with your own code.

    DEBUG CR, "Press and hold a number key 1, 2, 3, 4, 5, 6, 7, 8, 9,", CR
    DEBUG "or CH +/-, VOL +/- keys to control Bob."

    DO ' Main DO...LOOP

    GOSUB Get_Ir_Remote_Code ' Call remote code subroutine


    SELECT remoteCode ' Select message to display
    CASE 2, ChUp
    PULSOUT 13, 850 'Forward
    PULSOUT 12, 650
    CASE 4, VolDn 'Rotate Left
    PULSOUT 13, 650
    PULSOUT 12, 650
    CASE 6, VolUp 'Rotate Right
    PULSOUT 13, 850
    PULSOUT 12, 850
    CASE 8, ChDn 'Backward
    PULSOUT 13, 650
    PULSOUT 12, 850
    CASE 1 'Pivot Fwd-left
    PULSOUT 13, 750
    PULSOUT 12, 650
    CASE 3 'Pivot Fwd-right
    PULSOUT 13, 850
    PULSOUT 12, 750
    CASE 7 'Pivot Back-left
    PULSOUT 13, 750
    PULSOUT 12, 850
    CASE 9 'Pivot Back-right
    PULSOUT 13, 650
    PULSOUT 12, 750
    CASE ELSE 'Hold Position
    PULSOUT 13, 750
    PULSOUT 12, 750
    ENDSELECT

    LOOP ' Repeat main DO...LOOP


    Hope that is helpful.
Sign In or Register to comment.