Shop OBEX P1 Docs P2 Docs Learn Events
if then syntax / servo control and photosensor — Parallax Forums

if then syntax / servo control and photosensor

ArchiverArchiver Posts: 46,084
edited 2004-03-23 20:38 in General Discussion
I am new and dont know the syntax well enough.
Please help if you can.

how would I write the Pbasic code in correct "syntax" ?

Photo1.Bs2

DO

get rctime
value from
photo1 sensor

compute:
if rc time value is
+ 2000 > than
zero, then DO YES
if no then DO NO

DO NO
Do Photo1.Bs2 LOOP again

DO YES
read "last stored
servo position"
from eprom address

compute:
add
"one pulsout value"
to
"last stored servo position"

save answer of computation
in eprom address
"last stored servo position"

then read that stored value
then PULSOUT that stored value.

LOOP

Thanks
Dave..
Sign In or Register to comment.