#include <Stepper.h>
const int stepsPerRevolution = 512; // change this to fit the number of steps per revolution
// for your motor
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8,10,9,11);
int stepCount = 0; // number of steps the motor has taken
void setup() {
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
// step one step:
myStepper.step(1);
Serial.print("steps:" );
Serial.println(stepCount);
stepCount++;
delay(5);
}
想问,const int stepsPerRevolution = 512; 定义这一句是什么意思呢???着实是看不懂
此帖出自
小平头技术问答
一周热门 更多>