Shop OBEX P1 Docs P2 Docs Learn Events
PSC and continuously rotating servo — Parallax Forums

PSC and continuously rotating servo

demodemo Posts: 19
edited 2007-01-03 20:16 in BASIC Stamp
Hi,

I testing the PSC with BS2SX and continuously rotating servo. Just trying to get the servo move a bit and move back, can't be that difficult but still not getting it to work....servo starts to spin, but doesn't change rotating direction.

here's the code:

' {$STAMP BS2sx}
' {$PBASIC 2.5}

ch VAR Byte
pw VAR Word
ra VAR Byte
sDat CON 15
Baud CON 1021

ra = 1
ch = 1

DO
pw = 2500
SEROUT sDat, Baud+$8000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 20
pw = 1250
SEROUT sDat, Baud+$8000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 20
LOOP
Sign In or Register to comment.