Constant speed in for-loop

90 views
Skip to first unread message

BlueGene003

unread,
May 9, 2013, 6:10:21 AM5/9/13
to accels...@googlegroups.com
Hi,

I am using currently AH_Pololu to control my steppers, but now I want to change to AccelStepper. I still haven´t figured out how to get the Accelstepper to work with my code. Basically I want to use ArduinoSplines to be able to control the steppers with splines. With my code below it is working fine. For each step on the X-axis, the Y-axis is moving a different amount of steps each time.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
  for( long i = 0; i <= -P4x; i+= 1 ) {
    float temp = tempCurve.value(i);
    float tempPREV = tempCurve.value(i-1);
    long tempGerundet = long(temp+0.5);
    long tempPREVGerundet = long(tempPREV+0.5);

    stepperY.move((tempGerundet-tempPREVGerundet)*1);
    stepperX.move(-1);
  }
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

In the AH_Pololu library there is the function "move", as you can see above. As soon as the function is called, the stepper will move the amount of steps. Which function in Accelstepper could be used for my case?
Reply all
Reply to author
Forward
0 new messages