Shop OBEX P1 Docs P2 Docs Learn Events
BOE, IR + Gripper — Parallax Forums

BOE, IR + Gripper

Nishi .Nishi . Posts: 23
edited 2010-01-09 02:53 in Accessories
Hi, I'm new to the forum and to the world of robotics. I bought a BOE-Bot and a few accessories the other day and basically stayed up working through the book over the following 2 days. I have to say it was a great fun and I've learned a lot. But I'm still lacking in know how.

Last night after successfully getting BOE roaming with an ultrasonic ping sensor, I decided to break open and start to construct the 'Gripper' kit, it took me about an hour to fully construct and attach it, by which time I started to look for some example code I could try to modify or use as a jump point, but I couldn't find any. (I must have become spoiled by the abundance of sample code and examples for the ping sensor and panning kit) So far Ive written one test program, and another very sloppy 'fetch and run' program neither are very practical, but the gripperIF may help as a starting point for someone (green in robotics) with a kit and no code like me.

' BOEGripperIF.bs2   SIMPLE BOE-Bot Gripper Test Using Infra Red Detection by Nishi

' {$STAMP BS2}
' {$PBASIC 2.5}

DEBUG "Program Running!"

irDetectLeft VAR Bit                                            ' Variable Declarations..
irDetectRight VAR Bit
pulseLeft VAR Word
pulseRight VAR Word
pulseGrip   VAR   Word

FREQOUT 4, 2000, 3000                                           ' Signal program start/reset..

DO                                                              ' Main Routine..

    FREQOUT 8, 1, 38500                                         ' Check IR Detectors..
    irDetectLeft = IN9
    FREQOUT 2, 1, 38500
    irDetectRight = IN0
                                                                ' Gripper Action..

          IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN    'Gripper IF..

          pulseGrip = 1000                                           ' Close Gripper


          ELSE

          pulseGrip = 500                                            ' Open Gripper

          ENDIF
          PAUSE 20                                                   '(we PAUSE otherwise the servo hums,
                                                                     'gotta give the program time to run.)


        PULSOUT 13,pulseLeft                                    ' Apply the pulse..
        PULSOUT 12,pulseRight
        PULSOUT 14,pulseGrip

LOOP




But I'm still looking, so If you know of any practical gripper PBASIC code floating about please link me...


ps. (edited for spelling + is this the right forum to post this?)

IMG00105-20100109-0238-2.png

Post Edited (Tao) : 1/9/2010 3:11:10 AM GMT
Sign In or Register to comment.