PDA

View Full Version : code errors?



alucard
06-03-2005, 10:41 AM
http://forums.parallax.com/images/smilies/cry.gif·i need help
i been working on my own home made 12 servo biped robot. one of the smalls and lights of it kind... but to i start to try to program it and i have soo many problems trying to get 2 servo to move together here a simple please check it and tell me if iam worng

fas var word
faw var word
fx· var word
aas var word
aaw var word
ax· var word

fas = 1500
faw = 1000
aas = 100
aaw = 500

low 14
low 15

start:
for fx = fas to faw
for ax = aas to aaw
PULSOUT 14,fx
PULSOUT 15,ax
pause 45
next
GOTO start2

start2:
for fx = faw to fas
for ax = aas to aas
PULSOUT 14,fx
PULSOUT 15,ax
pause 45
next
GOTO start

how do i make to servo move like this?




·

Chris Savage
06-03-2005, 11:25 AM
Hello,

·· In each line you have two FOR routines, but only one NEXT...Also, try lowering your PAUSE from 45 to 20.



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

alucard
06-03-2005, 11:27 AM
thanks ill try it

alucard
06-03-2005, 11:57 AM
start:
for fx = fas to faw
for ax = aas to aaw
PULSOUT 14,fx
PULSOUT 15,ax
pause 45
next
next would work right?
GOTO start2

Chris Savage
06-03-2005, 10:50 PM
Hello,

·· Yes, it would work without the extra text after the NEXT command.· Also you should set the PAUSE statement down to 20.· Dracula fan?·

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

alucard
06-04-2005, 10:03 AM
alucard fan, not dracula, but his son

Chris Savage
06-04-2005, 01:11 PM
Ah, I knew it had something to do with that.· http://forums.parallax.com/images/smilies/tongue.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)