Two move in a row

Home Evil Mad Scientist Forums AxiDraw Two move in a row

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #29491
    Rody
    Participant

    I am using AxiDraw V3 with Python. Not for drawing.

    I would like to move the “pen” up to a specific position pause and then move it up again before moving locations.

    I am using penup() with a pen_pos_up value set to the first height. The I change the “pen_pos_up” value. When I use “moveto” or “penup()” followed by “goto” the pen does not rise the second time.

    Code:
    ad.options.pen_pos_up = 46
    ad.options.pen_delay_up = tdelay4
    ad.update()

    ad.penup()

    ad.options.pen_pos_up = 80
    ad.penup()

    ad.goto (9,0)

    It seems I can not give two “penup” or “pendown” commands in a row. Any suggestions?

    Thanks.

    #29492
    Windell Oskay
    Keymaster

    The penup() command raises the pen, if the pen is down. It does not raise the pen if it is already raised.

    The pendown() command lowers the pen, if the pen is up. It does not lower the pen if it is already lowered.

    I will also note that your ad.options.pen_pos_up = 80 command needs to be followed by an update().

    If you aren’t using the penup()/pendown() commands in the usual way — to lift and lower the pen between two independent states — then you might consider something like the following (which could be wrapped up as a function in your python script):

    ad.options.pen_pos_up = 80
    ad.options.pen_pos_down = 80
    ad.update()
    ad.penup()
    ad.pendown()
    

    That will set the pen up and pen down positions to be the same, and leave it in the pen-down logical state.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Two move in a row’ is closed to new replies.