New to Basic Stamp programming.
Hello everyone,
I'm new to stamp programming and I was wondering if someone in the
group could help me out.
My friend let me borrow a little robot car that he has so that I can
try to program and play around with. The car consists of a BS2
stamp on a Super Carrier board. There are two servos which drive
the robot, and two sensors which tell the robot when it has bumped
into something. I was able to get the car to move with the PULSOUT
command.
The problem is with the sensors. One is connected to PIN 12 and the
other is connected to PIN 13. They're both connected to PIN 0. I
figured what this means is that PIN 0 is driving a current and when
the car comes into contact with a wall, the switch is closed and
that current is carried through to either PIN 12 or 13 whichever
sensor it was. I've tried with the PULSIN command and I can't seem
to get it to work. Is there something I'm missing? I basically
just want to read whether or not there was any voltage on the PIN
and if there was react to it.
Any ideas?
Thanks in advance,
Phil
I'm new to stamp programming and I was wondering if someone in the
group could help me out.
My friend let me borrow a little robot car that he has so that I can
try to program and play around with. The car consists of a BS2
stamp on a Super Carrier board. There are two servos which drive
the robot, and two sensors which tell the robot when it has bumped
into something. I was able to get the car to move with the PULSOUT
command.
The problem is with the sensors. One is connected to PIN 12 and the
other is connected to PIN 13. They're both connected to PIN 0. I
figured what this means is that PIN 0 is driving a current and when
the car comes into contact with a wall, the switch is closed and
that current is carried through to either PIN 12 or 13 whichever
sensor it was. I've tried with the PULSIN command and I can't seem
to get it to work. Is there something I'm missing? I basically
just want to read whether or not there was any voltage on the PIN
and if there was react to it.
Any ideas?
Thanks in advance,
Phil
Comments
You only need to make Pin 0 a output and take it low (zero out). Then make
the Pin's 12 and 13 input's.
Next in your program you simply read the value of the two pins, if either
one is not high (a low or zero), then you have bumped into something. For
example you have two numbers on the front corners of the car. If pin 12 is
the left and pin 13 is the right bumper; then if pin 12 is low you can tell
the robot to backup for a second and turn right, if pin 13 is low then the
robot backs up for a second and turns left. If both a low then the robot
backsup for a second and turns around (say about 180 degrees).
Original Message
From: TelcoMan74 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=n90xV-hwyvLPyeVmyg5p1R4YpxPI9gn7-OIQRiGnE_HW3SoVGhs8JqyNstFL0b_sAoWlIha5BUMNg1RJhUs0]telcoman74@y...[/url
Sent: Wednesday, August 07, 2002 10:02 PM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] New to Basic Stamp programming.
Hello everyone,
I'm new to stamp programming and I was wondering if someone in the
group could help me out.
My friend let me borrow a little robot car that he has so that I can
try to program and play around with. The car consists of a BS2
stamp on a Super Carrier board. There are two servos which drive
the robot, and two sensors which tell the robot when it has bumped
into something. I was able to get the car to move with the PULSOUT
command.
The problem is with the sensors. One is connected to PIN 12 and the
other is connected to PIN 13. They're both connected to PIN 0. I
figured what this means is that PIN 0 is driving a current and when
the car comes into contact with a wall, the switch is closed and
that current is carried through to either PIN 12 or 13 whichever
sensor it was. I've tried with the PULSIN command and I can't seem
to get it to work. Is there something I'm missing? I basically
just want to read whether or not there was any voltage on the PIN
and if there was react to it.
Any ideas?
Thanks in advance,
Phil
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/