本文整理汇总了C++中AccelStepper::setSpeed方法的典型用法代码示例。如果您正苦于以下问题:C++ AccelStepper::setSpeed方法的具体用法?C++ AccelStepper::setSpeed怎么用?C++ AccelStepper::setSpeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AccelStepper
的用法示例。
在下文中一共展示了AccelStepper::setSpeed方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initSteppers
void initSteppers()
{
leftStepper.setSpeed(motorSpeed);
rightStepper.setSpeed(motorSpeed);
leftStepper.setAcceleration(motorAccel);
rightStepper.setAcceleration(motorAccel);
// Timer3.getAvailable().attachInterrupt(processSteppers).setPeriod(10).start();
}
示例2: turn
void turn(){
if(isTurning){
turntable.setSpeed(1000);
turntable.move(10);
turntable.runSpeed();
}
}
示例3: initialize_motor_driver
void initialize_motor_driver(){
pinMode(MICROSTEP, OUTPUT);
digitalWrite(MICROSTEP,LOW);
pinMode(ENABLE_PIN_0, OUTPUT);
pinMode(ENABLE_PIN_1, OUTPUT);
pinMode(STEP_PIN_0, OUTPUT);
pinMode(STEP_PIN_1, OUTPUT);
digitalWrite(MICROSTEP,HIGH);
//motors_release();
laser.setMaxSpeed(2000.0);
laser.setSpeed(700.0);
turntable.setMaxSpeed(2000.0);
turntable.setSpeed(700.0);
turntable_motor_release();
laser_motor_release();
}
示例4: home_y_axis
void home_y_axis(){
motors_enable();
while(!endStopSwitchReached(Y_ENDSTOP)){
step(y, 100, 10000, 10000);
}
y.setCurrentPosition(0.0);
y.setSpeed(10000.0);
motors_release();
}
示例5: init_motor_driver
void init_motor_driver(){
pinMode(MICROSTEP,OUTPUT);
pinMode(Z_ENABLE_PIN, OUTPUT);
pinMode(Y_ENABLE_PIN, OUTPUT);
motors_release();
z.setMaxSpeed(200000.0);
z.setSpeed(10000.0);
y.setMaxSpeed( 100000.0);
y.setSpeed(1000.0);
// Endstops
pinMode(Y_ENDSTOP, INPUT);
digitalWrite(Y_ENDSTOP, HIGH);
motors_enable();
}
示例6: step
void step(AccelStepper motor, float steps, float speed_value, float acceleration){
motor.moveTo(motor.currentPosition()+steps);
motor.setSpeed(speed_value);
//motor.setAcceleration(acceleration);
// Implementation without acceleration.
while (motor.distanceToGo() != 0)
motor.runSpeedToPosition();
//motor.run();
}
示例7: home_z_axis
void home_z_axis(){
motors_enable();
while(!endStopSwitchReached(Z_ENDSTOP)){
step(z, 10, 80000, 10000);
}
z.setCurrentPosition(0.0);
z.setSpeed(30000.0);
motors_release();
}
示例8: step
void step(int motor, float steps, float feedrate){
AccelStepper stepper;
if (motor == TURNTABLE_STEPPER ){
stepper = turntable;
}
if (motor == LASER_STEPPER){
stepper = laser;
}
stepper.move(steps*SCALER);
stepper.setSpeed(100);
//motor.setAcceleration(acceleration);
// Implementation without acceleration.
while (stepper.distanceToGo() != 0)
stepper.runSpeedToPosition();
//motor.run();
}
示例9: setSpeed
void setSpeed(int desiredSpeed)
{
leftStepper.setSpeed(desiredSpeed);
rightStepper.setSpeed(desiredSpeed);
}
示例10: stepper_reset_done
void stepper_reset_done() {
Astepper1.setSpeed(0);
Astepper1.runSpeed();
}