Thread: Draw Circle

  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Rep Power

    Draw Circle

    Hello All
    I have designed an XY table with two stepper motors. One stepper motor controls the x -axis and the other controls the y –axis. I simply send a command to the parallel port which in turn sends the command to the stepper motors. Each command sends one step. One hundred steps will move the x or y axis 1mm. That is 100 steps per mm. I know how to send enough steps to draw straight lines. A line 50mm long will mean 50 x100 =5000 steps. Eg: …for 1 to 5000 do PORT[$78] := #4 . This will send 5000 steps to the X motor and so on. However I do not know any circle or ellipse algorithm. Could anyone help me with some Delphi code to send steps for a circle? I shall appreciate all help.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2010
    Rep Power
    did you try researching about drawing algorithms? Try. Here is the Bresenham algorithm for line and circle. You can try implementing it in Delphi.


IMN logo majestic logo threadwatch logo seochat tools logo