Shop OBEX P1 Docs P2 Docs Learn Events
s2.spin: determining when a movement is done? — Parallax Forums

s2.spin: determining when a movement is done?

gcodergcoder Posts: 3
edited 2012-11-28 15:22 in Propeller 1
With the existing s2.spin code is there a way to determine when a movement has been completed?
In other words, given a 'move_to(0, 100)' command, how can I determine when the robot has reached the target position?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-11-27 10:11
    The moving method returns true until all current and pending motions have completed.

    -Phil
  • gcodergcoder Posts: 3
    edited 2012-11-28 09:31
    Thanks! I hadn't noticed that moving cmd.

    While I'm here- how many motion cmds can safely be buffered within a beginPath/endPath block? I ask because I am trying to stream gcode to my S2 through the Fluke2 board.

    (oh and Port Townsend - lovely place. I did an artist's residency for a few months at Centrum/Fort Worden @ 15 yrs ago. Fabulous time).
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-11-28 15:22
    When in a "path", only two movements are buffered. After that it blocks. The purpose of the path is simply to permit a smooth velocity interpolation between successive movements, so there's not an excess of starting and stopping, which would result in jerky motion.

    ('Glad you liked P.T! Centrum is still going strong to this day.)

    -Phil
Sign In or Register to comment.