Shop OBEX P1 Docs P2 Docs Learn Events
bs2 source code: to send bang to max/msp using sony tv remote control — Parallax Forums

bs2 source code: to send bang to max/msp using sony tv remote control

tascencaotascencao Posts: 11
edited 2006-04-22 20:39 in BASIC Stamp
hello list, i recently posted, but have more info for my question now. thanks to everyone who tried to help last time!

i'm really new to all this and am trying to find some bs2 source code to start.

basically, i'm trying to get bs2 to send a bang to max/msp when i press buttons on a remote control. i already have all the remote codes decoded.

i found this source code below which i'm trying to modify to send a bang to max/msp. right now it uses buttons 1-4 on the remote control, but tells a robot to move forward/backward etc. as i'm working on something different (interactive video), i need to modify that last part of the code to simply send a bang to max/msp.

any help, insight or references appreciated!

teresa


' IR Remote for the Boe-Bot - 2BitRemoteBoeBot.bs2
' Control your Boe-Bot with an IR remote set to control a SONY TV
' with the 1-4 or CH+/- and VOL+/- keys.


time VAR WORD(2) ' SONY TV remote variables.
DEBUG "Press and hold a digit key (1-4) or CH+/- and VOL+/-..."

FREQOUT 4, 2000, 3000 ' Start/reset indicator.

DO ' Beginning of main loop.

DO ' Wait for rest between messages.
PULSIN 9, 1, time(0)
LOOP UNTIL time(0) > 1000

PULSIN 9, 0, time(0) ' Measure/store data pulses.
PULSIN 9, 0, time(1)

' Decide which maneuver to execute depending on the combination
' of pulse durations stored in the first two pulse measurements.

IF (time(1) < 500) AND (time(0) < 500) THEN
PULSOUT 13, 850 ' Forward
PULSOUT 12, 650
ELSEIF (time(1) < 500) AND (time(0) > 500) THEN
PULSOUT 13, 650 ' Backward
PULSOUT 12, 850
ELSEIF (time(1) > 500) AND (time(0) < 500) THEN
PULSOUT 13, 850 ' Right rotate
PULSOUT 12, 850
ELSEIF (time(1) > 500) AND (time(0) > 500) THEN
PULSOUT 13, 650 ' Left rotate
PULSOUT 12, 650
ENDIF

LOOP ' Repeat main loop.

Comments

  • A.C. fishingA.C. fishing Posts: 262
    edited 2006-04-22 20:37
    the PULSOUT command tells the robot to send a PULSE to one of its servos.
    But instead of that happening, from your other post, you want your BS2 to tell your computer using a serial cable, right?
    Then you should use the SEROUT and SERIN commands.
    I have never done this, so someone else will help you with how to use the ser commands
    A.C.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Somebody said...
    -Never Underestimate the power of human stupidity.
    ·
  • tascencaotascencao Posts: 11
    edited 2006-04-22 20:39
    hey AC, thanks again. that makes sense. i remember the serin and out you mentioned before. i will see if that's all i have to change.

    thanks!
    teresa
Sign In or Register to comment.