If pin goes high then do this?
Hello,
Does anybody know how to write an IF..THEN that will watch the state of a
pin. I don't see it in the manual. I don't know how to read just one pin.
Thanks
Kevin
Does anybody know how to write an IF..THEN that will watch the state of a
pin. I don't see it in the manual. I don't know how to read just one pin.
Thanks
Kevin
Comments
Assuming Pin 0
if in0 = 0 then stop
if in0 = 1 then go
Sid
writes:
> Assuming Pin 0
>
> if in0 = 0 then stop
>
Here's another approach that uses less code:
BRANCH In0,[noparse][[/noparse]Stop, Go]
-- Jon Williams
-- Parallax
[noparse][[/noparse]Non-text portions of this message have been removed]
Original Message
> Does anybody know how to write an IF..THEN that will watch the state of a
> pin. I don't see it in the manual. I don't know how to read just one
pin.
Kevin
Original Message
From: Rodent [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=vlwwaUse4IpHkNz2Tng9PenP4ATVHOrzCxYR_XKS_zDB0d9q5a6csl0VeEoybIinwrm3YU_rCOUNjm4]daweasel@s...[/url
Sent: Sunday, November 18, 2001 3:06 PM
To: basicstamps@yahoogroups.com
Subject: Re: [noparse][[/noparse]basicstamps] IF PIN GOES HIGH THEN DO THIS?
IF IN1 = 1 THEN....
Original Message
> Does anybody know how to write an IF..THEN that will watch the state of a
> pin. I don't see it in the manual. I don't know how to read just one
pin.
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/
a variable and branch according to the value of the variable. I use this on
one of my robots to read all of the line sensors at once -- works very well
and prevents me from having to check each pin one at a time.
Buy / beg / borrow / steal the Nuts & Volts of Basic Stamps books -- lots of
good info you won't find in the Stamp manual or in the online documentation.
Original Message
> Thanks everybody for the support!
> IF IN1 = 1 THEN....
> > Does anybody know how to write an IF..THEN that will watch the state of
a
> > pin. I don't see it in the manual. I don't know how to read just one
> pin.
daweasel@s... writes:
> Buy / beg / borrow / steal the Nuts & Volts of Basic Stamps books -- lots of
>
Better yet, BUY them from Parallax!!! ;-)
-- Jon Williams
-- Parallax
-- ... and a contributor to the above-mentioned books.
[noparse][[/noparse]Non-text portions of this message have been removed]
Any BS2P package weekend deals coming up? I was thinking about a BS2P40 and
one of those I2C clock / RAM modules. Might even design and build a real
circuit board for this robot.
For anyone interested, Radio Shack has the "Spy Kids" RC mini-van for $10
off -- now $30. Lots of room internally for robot guts and a sunroof that
looks like it would be good for an LCD display. The sucker is fast too, and
has a turbo mode. Unfortunately you pay more for a NiMH battery and charger
than for the car.
Original Message
> > Buy / beg / borrow / steal the Nuts & Volts of Basic Stamps books --
lots of
> >
>
> Better yet, BUY them from Parallax!!! ;-)