Shop OBEX P1 Docs P2 Docs Learn Events
irods — Parallax Forums

irods

ArchiverArchiver Posts: 46,084
edited 2002-11-22 16:50 in General Discussion
I am not sure how to wire in a irod for object detection. I am using
BS2p and have my motor running of an Hbridge.
pin o is forward, pin 1 is backward and pin 3 is ground.

the motor is not supposed to start until an object is detected, then
follow thru the code and return to its starting point where it will
wait to begin when an object is detected.

the code I have thus far is:

'{$STAMP BS2p}

x var byte

output 2

high 2


top:

for x = 1 to 75 'length of roatation

pwm 1, x, 40 'clockwise rotation

next

pause 3000



for x = 1 to 75 'length of roatation

pwm 1, x, 40 'clockwise rotation

next

pause 5000


for x = 1 to 80

pwm 0, x, 40 'ccw roatation

next

pause 2000

for x = 1 to 70

pwm 0, 200, 40



goto top:


I am using the sharp gp2d05 black wire into vss and red wire in vdd.

green wire? blue wire ?


any idea's how to finsih this wiring?????


john

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-11-22 16:50
    > I am not sure how to wire in a irod for object detection. I am using
    > BS2p and have my motor running of an Hbridge.
    > pin o is forward, pin 1 is backward and pin 3 is ground.
    >
    > the motor is not supposed to start until an object is detected, then
    > follow thru the code and return to its starting point where it will
    > wait to begin when an object is detected.

    <snip>

    > I am using the sharp gp2d05 black wire into vss and red wire in vdd.
    >
    > green wire? blue wire ?

    Not sure how you came by this as IRODS was discontinued quite a
    while ago as SHARP stopped making the GP2D05....

    The GP2D05 has a single bit output. You set a 'trigger' distance
    using a tiny pot on the rear of the unit and when something comes
    within range, it sets the bit LOW. You need to start the
    measurement process with a pulse on the green wire. The output
    comes on the blue wire.

    Here is the example code we provided in the kit:

    ‘Measurement and Calibration Routine for IRODS using a BS2
    ‘P0 is connected to the voltage divider, which in turn goes to Vin
    (green wire)
    ‘P1 is connected to Vout (blue wire)

    START: High 0 ‘Make sure that Vin sees a high-low transition
    Pause 3 ‘Wait for it to be seen
    Low 0 ‘Begin measurement sequence
    Pause 56 ‘Wait for measurement sequence to complete
    If IN1=0 Then SHOW ‘If object detected, tell me
    Goto START ‘No object detected, start over

    SHOW: Debug “Object Detected”, cr ‘Display “Object Detected” in
    debug window
    Pause 5000 ‘Wait 5 seconds (remove when done calibrating)
    Goto START ‘Start over
    END

    If you contact me off-list I can send you a PDF of the instructions
    that came with IRODS.

    BTW, Keep an eye on the HVW Tech. website
    (http://www.HVWTech.com) for news on our new digital output
    version that will connect directly to a Stamp and provide range
    information in a number of formats.

    Mark Hillier, VE6HVW
    President, HVW Technologies Inc.
    Canadian Distributors of Parallax Products and other Neat Stuff
    Tel: (403)-730-8603 Fax: (403)-730-8903
    See our NEW FPGA Experimenter Board
    http://www.hvwtech.com/intro-fpga.htm
Sign In or Register to comment.