Ping Sensor for johnny 5

I have the Ultrasonic range sensor for my johhny 5 Part# URS-02 , how do i go about getting this to working condition and using it? keep in mind I’m still new to all programming and knowing what to do. i have the ssc-32 board and the basic atom pro. Thank you

Here are three sample Atom Pro programs for you to investigate.

lynxmotion.net/viewtopic.php?t=4714

:unamused: Now that I have the code for doing the ping sensor, what wire do I use to connet the sensor and where do I plug that in? Thanks again

It depends on which code example you are looking at. In this one you use pin 4. As indicated by the P4 in the pulsout and pulsin commands. You might want to crack the programming manual.

[code]wdist var word

main:
low p4
pulsout p4, 5
input p4
pulsin p4, 0, toolong, 40000, wdist
wdist = wdist / 148 ;convert for inches
serout s_out, i9600, "Distance: ", sdec wdist, 13, 10] ;display result in terminal
goto main

toolong: ; if the program gets here the sensor is not functioning, or wired wrong
serout s_out, i9600, “Timeout, sensor is not working”, 13]
goto main[/code]

The ping connects to the Bot Board with a standard servo extender cable. You also need to jumper the power bus for the port it connects to to 5vdc.

Ok so do I need a 3 pin connector on one end to connect to the ping sensor then the other side to be a two pin or does it also have to be a three pin? With the jumper for the power bus where is that located and do I need to purchase anything for that? Thank you for the help again :smiley:

A servo extender cable is available in 6", 12", or 24" length.

You pull the header pins out of one end, plug in the Ping, then plug the other end into the Bot Board II with the black wire closest to the outside of the board. Please review the Bot Board II users manual for information on how to set up the power rail for the I/O group you are using.