# include<AccelStepper.h>
const int dirPin = 3; // Pin which is used to accept the signal that determine the rotational speed of the motor
const int stepPin =2; // Pin which is used to accept the pulse signal(one pulse corresponds to one step only)
float speed = 100;
AccelStepper myStepper(1,stepPin,dirPin); // Easy Driver mode
void setup() {
// put your setup code here, to run once:
//myStepper.setSpeed(100);
myStepper.move(100);
myStepper.setSpeed(speed);
Serial.begin(9600);
Serial.println(myStepper.speed());
}
void loop() {
// put your main code here, to run repeatedly:
myStepper.runSpeed();
Serial.print("CUS POS:");
Serial.println(myStepper.currentPosition());
The speed of motor is always one, can any tell me what happen ?