I am corrently working on a biped project. I am using a bot board with atom 24 and the ssc32. I wrote this program, and one servo twitches, and the rest do nothing. Can any tell me how to fix. My ssc32 is conected to p15, on the bot board. Thankyou
This is the program:
’ Atom / SSC-32 Test
’ Configure the SSC-32 for 38.4k baud.
servo15pw var word
movetime var word
servo15pw = 1000
movetime = 2500
start:
servo15pw = 1000
serout p15,i38400,"#0P",DEC servo15pw,“T”,DEC movetime,32]
pause 1000
servo15pw = 2000
serout p15,i38400,"#0P",DEC servo15pw,“T”,DEC movetime,32]
pause 1000
goto start
’ Biped example program.
aa var byte '<- general purpose variable.
rax var word '<- right ankle side-to-side. On pin0
ray var word '<- right ankle front-to-back. On pin1
rkn var word '<- right knee. On pin2
rhx var word '<- right hip front-to-back. On pin3
rhy var word '<- right hip side-to-side. On pin4
rht var word '<- right hip twist. on pin5
lax var word '<- left ankle side-to-side. On pin16
lay var word '<- left ankle front-to-back. On pin17
lkn var word '<- left knee. On pin18
lhx var word '<- left hip front-to-back. On pin19
lhy var word '<- left hip side-to-side. On pin20
lht var word '<- left hip twist. on pin21
ttm var word '<- time to take for the current move.
’ First command to turn the servos on.
for aa=0 to 32
serout p15,i38400,"#", DEC2 aa\1, “P”, DEC 1500, 32]
next
walk:
’ First position for step sequence, and time to move, put in your values here.
rax=1500: ray=1500: rkn=1500: rhx=1500: rhy=1500: rht=1500
lax=1500: lay=1500: lkn=1500: lhx=1500: lhy=1500: lht=1500
ttm=2000
gosub send_data
pause ttm
then
’ Secound
rax=1500: ray=1500: rkn=1500: rhx=1500: rhy=1500: rht=1500
lax=1500: lay=1500: lkn=1500: lhx=1500: lhy=1500: lht=1500
ttm=2000
gosub send_data
pause ttm
’ Third…
’ Forth…
’ Etc…
goto walk
’ This sends the data to the SSC-32. The serout is all one line, no Wrap!
send_data:
serout p15,i38400,"#0P", DEC rax,"#1P", DEC ray,"#2P", DEC rkn,"#3P", DEC rhx,"#4P", dec rhy,"#5P", DEC rht,"#16P", DEC lax,"#17P", DEC lay,"#18P", DEC lkn,"#19P", DEC lhx,"#20", dec lhy,"#21", dec lht,“T”, DEC ttm,13]
return