/**
 * Supports movement with both styles of Motor Shield
 * @input newx the destination x position
 * @input newy the destination y position
 **/
void onestep(int motor,int direction) {
  if(motor==1) {
#ifdef VERBOSE
    Serial.print('X');
#endif
#if MOTOR_SHIELD_VERSION == 1
      m1.onestep(direction);
#else
      m1->onestep(direction>0?FORWARD:BACKWARD,SINGLE);
#endif
  } else {
#ifdef VERBOSE
    Serial.print('Y');
#endif
#if MOTOR_SHIELD_VERSION == 1
      m2.onestep(direction);
#else
      m2->onestep(direction>0?FORWARD:BACKWARD,SINGLE);
#endif
  }
}
// you can change these to DOUBLE or INTERLEAVE or MICROSTEP!
void stepper_forwardstep1() {
  myStepper1.onestep(FORWARD, MICROSTEP);
}
void stepper_backwardstep1() {  
  myStepper1.onestep(BACKWARD, MICROSTEP);
}
void stepper_reset_lp() {
  myStepper1->onestep(BACKWARD, DOUBLE);
  delayMicroseconds(300);
}
示例#5
0
void backwardstep() {  
	  stepper_motor.onestep(BACKWARD, DOUBLE);
}
示例#6
0
void forwardstep() {  
	  stepper_motor.onestep(FORWARD, DOUBLE);
}
示例#7
0
文件: motor.cpp 项目: galoompa/pl
void backwardstep() {  
  lat_motor.onestep( BACKWARD, INTERLEAVE );
}
示例#8
0
文件: motor.cpp 项目: galoompa/pl
void forwardstep() {  
  lat_motor.onestep( FORWARD, INTERLEAVE );
}