Shop OBEX P1 Docs P2 Docs Learn Events
code errors? — Parallax Forums

code errors?

alucardalucard Posts: 4
edited 2005-06-04 05:11 in BASIC Stamp
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?




·

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-03 03:25
    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
  • alucardalucard Posts: 4
    edited 2005-06-03 03:27
    thanks ill try it
  • alucardalucard Posts: 4
    edited 2005-06-03 03:57
    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 SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-03 14:50
    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
  • alucardalucard Posts: 4
    edited 2005-06-04 02:03
    alucard fan, not dracula, but his son
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-04 05:11
    Ah, I knew it had something to do with that.· tongue.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.