Shop OBEX P1 Docs P2 Docs Learn Events
Mini SSC Servo Controller Help — Parallax Forums

Mini SSC Servo Controller Help

ArchiverArchiver Posts: 46,084
edited 2001-06-06 01:19 in General Discussion
Hello,
I am currently working on a mulitiple servo system using a BS2e. I
have it hooked up to the Scott Edwards Mini SSC controller via serial
communication. The problem is, in my code:
'{$STAMP BS2e}

svo con 0

sync con 255

pos var byte

n96n con $4054

n24n con $418D

IOpin4 var bit

IOpin4 = in4

if iopin4 = 0 then moveright

if iopin4 = 1 then moveleft

moveright:

serout 0,n96n,[noparse][[/noparse]sync,0,0]

serout 0,n96n,[noparse][[/noparse]sync,1,0]

serout 0,n96n,[noparse][[/noparse]sync,2,0]

serout 0,n96n,[noparse][[/noparse]sync,3,0]

return

moveleft:

serout 0,n96n,[noparse][[/noparse]sync,0,254]

serout 0,n96n,[noparse][[/noparse]sync,1,254]

serout 0,n96n,[noparse][[/noparse]sync,2,254]

serout 0,n96n,[noparse][[/noparse]sync,3,254]

return

I have written/hacked a little code from several places to come up
with this simple program that scans pin 4 on the basic stamp for a
switch toggle. Is there any way to keep the BS2 from constantly
sending the same signal to the SSC. I know the SSC holds the servo in
one position with only one signal and I am trying to keep it from
sending it every time the program loops. The other thing is, if I
keep looping here how do I add code to monitor other stuff at
the same time, or does it have to be in the body of the loop? Kinda
sucks if you can only monitor one thing because you have to keep
looping. Thanks for any help,

Dave
Sign In or Register to comment.