求大神帮忙,有关步进电机

2019-03-26 19:29发布

#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;  定义这一句是什么意思呢???着实是看不懂

此帖出自小平头技术问答
0条回答

一周热门 更多>