Thanks for the tip.
I'm still not getting any kind of speed out of the motor. Here's the code i'm now using:
#include <AccelStepper.h>
#include <AFMotor.h>
AF_Stepper motor1(200, 1);
void forwardstep1() {
motor1.onestep(FORWARD, DOUBLE);
}
void backwardstep1() {
motor1.onestep(BACKWARD, DOUBLE);
}
AccelStepper stepper1(forwardstep1, backwardstep1);
void setup()
{
stepper1.setMaxSpeed(300.0);
stepper1.setAcceleration(15.0);
stepper1.moveTo(1000);
}
void loop()
{
if (stepper1.distanceToGo() == 0)
stepper1.moveTo(-stepper1.currentPosition());
stepper1.run();
}
It's a version of one of the examples. It's the only one that would work with a bit of tweaking. The result i get is as follows. It speeds up to about 20rpm then wiggles back and forth - then it obviously reached it's distance and does the same in the other direction.
Any other tip? With the code i'm using what would the expected results be?
Thanks