Shop OBEX P1 Docs P2 Docs Learn Events
Programing a (GWS) NARO Servo — Parallax Forums

Programing a (GWS) NARO Servo

AntonuccioAntonuccio Posts: 17
edited 2012-01-22 16:39 in BASIC Stamp
I am currently trying to program a few (GWS) NARO Servos (sold by Parallax) and am having trouble getting them moving. I am using a Basic stamp 2 attached to a Board of Education and a Propeller Servo Controller Unit with a 4.8v power source. When I attach standard servos to my PSCU and run my test program they perform perfectly. However the NARO Servos or micro servos or whatever you want to call them do not respond at all. I am a programming novice and I believe my problems lie in my programing. The test program I wrote is below. If anyone spots a flaw that would render my NARO servos inactive please let me know.

'{$STAMP BS2}
'{$PBASIC 2.5}


' Set baud for all STAMP versions
#SELECT $STAMP
#CASE BS2SX, BS2P
N2400 CON 1021 + $8000
N38K4 CON 45 + $8000
#CASE BS2PX
N2400 CON 1646 + $8000
N38K4 CON 84 + $8000
#CASE #ELSE
N2400 CON 396 + $8000
N38K4 CON 6 + $8000
#ENDSELECT




ch VAR Byte
'ch0 VAR Byte
pw VAR Word
ra VAR Byte


'SERVO ASSIGNMENTS
FOOT1 VAR Byte
FOOT2 VAR Byte


FOOT_UP VAR Word
FOOT_DOWN VAR Word


Main:
FOOT1 = 3
FOOT2 = 4


FOOT_UP = 850
FOOT_DOWN = 600


Sdat CON 15
baud CON 396




ra = 10'speed adjust


DO


SEROUT Sdat, N2400, ["!SC", FOOT1, ra, FOOT_DOWN.LOWBYTE, FOOT_DOWN.HIGHBYTE, CR]
'PAUSE 100
SEROUT Sdat, N2400, ["!SC", FOOT2, ra, FOOT_DOWN.LOWBYTE, FOOT_DOWN.HIGHBYTE, CR]


PAUSE 2000


SEROUT Sdat, N2400, ["!SC", FOOT1, ra, FOOT_UP.LOWBYTE, FOOT_UP.HIGHBYTE, CR]
'PAUSE 100
SEROUT Sdat, N2400, ["!SC", FOOT2, ra, FOOT_UP.LOWBYTE, FOOT_UP.HIGHBYTE, CR]


PAUSE 2000


LOOP
END

Comments

Sign In or Register to comment.