' Remote Robotic Arm Source Code by nolebotic.com___ 2/2008____ This code is a modified version of the IR Remote for the Boe-Bot ' ' 2BitRemoteBoeBot.bs2 code from parallax.com . Relax and have fun. ' Control a simple servo based robotic arm with a Sony IR remote control. ' number 1 and 2 keys for opening and closing gripper. '{$STAMP BS2} '{$PBASIC 2.5} time VAR Word(2) ' SONY TV remote variables. DO ' Beginning of main loop. DO ' Wait for rest between messages. PULSIN 8, 1, time(0) LOOP UNTIL time(0) > 1000 PULSIN 8, 0, time(0) ' Measure/store data pulses. PULSIN 8, 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 14, 850 ' Forward PULSOUT 14, 650 ELSEIF (time(1) < 500) AND (time(0) > 500) THEN PULSOUT 14, 650 ' Backward PULSOUT 14, 850 ELSEIF (time(1) > 500) AND (time(0) < 500) THEN PULSOUT 14, 850 ' Right rotate PULSOUT 14, 850 ELSEIF (time(1) > 500) AND (time(0) > 500) THEN PULSOUT 14, 650 ' Left rotate PULSOUT 14, 650 ENDIF LOOP ' Repeat main loop.