/**
 * 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);
}
Exemple #5
0
void backwardstep() {  
	  stepper_motor.onestep(BACKWARD, DOUBLE);
}
Exemple #6
0
void forwardstep() {  
	  stepper_motor.onestep(FORWARD, DOUBLE);
}
Exemple #7
0
void backwardstep() {  
  lat_motor.onestep( BACKWARD, INTERLEAVE );
}
Exemple #8
0
void forwardstep() {  
  lat_motor.onestep( FORWARD, INTERLEAVE );
}