title: Draw a circle using 2 stepper motors (Arduino)
body: <p>I want to draw a circle using 2 stepper motors(42H48) and 2 drivers (TB6560).</p>
  
  <p>The hardware are like this:</p>
  
  <pre>
     (y-axis motor)
         |
         |
  --—--- |-------- (x-axis motor)
         |
         |
  </pre>
  
  <p>Now, i only can control these motors to draw like Diamond shape.</p>
  
  <pre><code>// 1
  digitalWrite(xAxisMotorDirection, HIGH);
  digitalWrite(yAxisMotorDirection , HIGH);
  for(i=0; i&lt;12000; i++)
  {
      digitalWrite( xAxisMotorPulse, HIGH);
      digitalWrite( yAxisMotorPulse , HIGH);
      delay(1);
      digitalWrite( xAxisMotorPulse , LOW);
      digitalWrite( yAxisMotorPulse , LOW);
      delay(1);
  }
  
  // 2
  digitalWrite(xAxisMotorDirection, HIGH);
  digitalWrite(yAxisMotorDirection , LOW);
  for(i=0; i&lt;12000; i++)
  {
      digitalWrite( xAxisMotorPulse, HIGH);
      digitalWrite( yAxisMotorPulse , HIGH);
      delay(1);
      digitalWrite( xAxisMotorPulse , LOW);
      digitalWrite( yAxisMotorPulse , LOW);
      delay(1);
  }
  
  // 3
  digitalWrite(xAxisMotorDirection, LOW);
  digitalWrite(yAxisMotorDirection , LOW);
  for(i=0; i&lt;12000; i++)
  {
      digitalWrite( xAxisMotorPulse, HIGH);
      digitalWrite( yAxisMotorPulse , HIGH);
      delay(1);
      digitalWrite( xAxisMotorPulse , LOW);
      digitalWrite( yAxisMotorPulse , LOW);
      delay(1);
  }
  
  // 4
  digitalWrite(xAxisMotorDirection, LOW);
  digitalWrite(yAxisMotorDirection , HIGH);
  for(i=0; i&lt;12000; i++)
  {
      digitalWrite( xAxisMotorPulse, HIGH);
      digitalWrite( yAxisMotorPulse , HIGH);
      delay(1);
      digitalWrite( xAxisMotorPulse , LOW);
      digitalWrite( yAxisMotorPulse , LOW);
      delay(1);
  }
  </code></pre>
  
  <p>Any good approach to draw a circle using pulse ?</p>
  
  <p>I googled "bresenham algorithm" , but I have no idea how to implement this algorithm using pulse.</p>