Re: [sisqocracker] Basic STAMP2,
Sonics and the ER1 [In
reply to]
Can't Post
Hi
Coop I installed the python. Now I have your
two sets of files, emailed smaller sets, and
thread larger set. Tried the stamp hook up but
it looks like I might need an adaptor.Do you have
your stamp software in your desktop?laptop? or
both?I can put the software in the desktop with
its serial plug it comes with,but the laptop needs
converter to usb.What do you think?Ron ----
Yeah you need a com port on whatever the robot
is using for a brain. I've got a dedicated mother
board on the bot that has it's own 12v dc-dc
converter in it. And that has a real com port on
it. Note: I've tried using a USB to com adapter
and couldn't get the Stamp port to operate.
Hopefully you won't have that issue. Mine I tried
was from CablesToGo.
Put the runbot.py
file in the C:\Python23 directory. After you get
the Stamp working on serial to something, load the
coopscommo.bs2 into the Stamp itself. If you read
how to do a tutorial, it'll explain how to load
your program into the Stamp.
Gimme a shout
when you have the debug output window open from
uploading the Stamp and can have the servo moving
from doing the command 04 (zero four). That should
set the servo into motion for a sweep. The SRF4
sonic needs to get plugged into 5v, gnd, and the
stamp on two pins. The servo gets plugged into 5v,
gnd and one pin on the stamp. Let me look at the
program (coopscommo.bs2)and I'll reply with what
pins those are.
----
C:\Python23
is where I put the RunBot.py.I just put it in the
folder.This must be the same as C:\Python23
directory that you told me. I didn't read the
tutorial on loading coopscommo.bs2 into the stamp
yet, but when i put it on my desktop, of my
laptop, I must have hit it twice as the stamp
program opened up and I think it was there.Does
this mean it want to cooperate?Wow! You said
give you a shout, so I guess here it is don't know
what to do with the stamp window open but I'm a
lookin' Ron
----
You should have a
button on the toolbar at the top of the Stamp
window for RUN. It looks like a blue triangle
pointing to the right like a play button icon
would on a disc or tape player. Hit that and if
the machine you're on is hooked up to the stamp
then it will find the COM port with the Stamp on
it and load the program into the Stamp itself.
Once it's in there it is running all the time the
Stamp has power. When the Stamp is powered off
it's still in there and will run from the program
start again once it's powered back on.
That's what I like about standards and
things like this, that if you follow the same
hardware and software that it is portable to other
machines and it does work the same way from one
machine to another. Am glad you're finally having
some level of success because you need that to
learn how this stuff works. Isn't too much of a
lesson when everything you try doesn't give any
results. :-) Anyways, glad I could help so far.
You'll be on your way to doing cool stuff before
long. Now that I have the program open here I'm
looking up the pin numbers to have you plug your
sonic and servo into so that you can get that part
working and talk serially to the Stamp and get
some output from that sonic.
The Init pin
on the SRF4 get connected to pin0 on the Stamp.
The Echo (or return) pin on the SRF4 gets
connected to pin1 on the Stamp. You've got 5volts
and ground to connect off of the SRF4 aside from
that. What I did for that was take 5 volts from a
pin off of the 25 pin analog connector on the RCM.
I'll explain more on that in another paragraph
following this one. The servo needs 5 volts,
ground and connected to pin13 on the Stamp. The
colors black, red, white on the servo are GND, 5v
and StampPin respectively. I ran some solid wire I
got from RadioShack, it came in 3 colors on 3
spools and was called solid hook-up wire. I'm sure
I have the gauge or part number on another thread
out on evo's forums, I just can't remember right
now what the size is. It comes in red, green and
black spools. Anyway, I plugged the servo's
connector into one of each color (I used black for
ground, red for red and green for signal (white on
the servo) and ran that back down to where it
would reach my Stamp on the back of my bot. There
are pics in the gallery that you can see that much
better in. I used a drill and twisted the three
colors together. Just cut the length that would
reach plus about 15% as you loose some of the
length when you twist it. And that way it stays
nice and bundled.
The other bit I said I
would write more about is where I took a 25 pin
connector with hood and soldered in all 25 wires
with the same hook-up wire I used on the servo,
and made the 5v ones red and the GND ones black
and the rest that are analog inputs green and I
plugged them into a bread board that lives
adjacent to the Stamp on the back of the bot. I
just used a project box to mount all this stuff
onto and put them side by side in the project box
so now I have the analog port available to me
without having to hook up more stuff in the
future, I can just plug into the bread board and
have an analog device which I can query in my
Python script via telnet into the ER1 and get A/D
without having to make one myself. Anyway, this is
how I made an easy connection for 5 volts and
Ground for the Stamp that was right beside it. I
used that same 5 volts and ground to power the
servo, and the SRF4 sonic sensor.
Look
back to the gallery and decide how you want to
mount your sonic, most of us who has just one on a
servo to sweep with have done basically the same
thing. Keep it in the middle towards the rear
(facing forward) of the bot as it can't see too
well if it were to get too close to wall directly
in front of it and it was mounted on the front of
the bot. The other thing you'll notice in my Stamp
program is called left corner, right corner, this
is for a command of 02 (for left corner) or 03 for
right corner and this moves the servo to a
predetermined location and fires it, averages the
returns and sends that back to you on the serial
line. I was doing this for OA for the corners of
the bot. You have to make something of that in the
Python script as he will be getting the data back
(after you tell him to send those commands up the
serial line). So I haven't written that routine
yet. Plenty to do yet, but you can see how much
I've made work and how much I have set aside by
what's remarked out of the python script and what
is not. Szia, Mark
ER1-TC10k
mobo-winXPpro-Logi4kCam-26Ah Batt-STAMP2 driving
servos and sonics (SRF04).
Please respect other members and
do not post content that is obscene. Refrain from using the
community for commercial or advertising purposes. Report
any violations to Customer
Service.