Exemplo n.º 1
0
/**
 * 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
  }
}
Exemplo n.º 2
0
// you can change these to DOUBLE or INTERLEAVE or MICROSTEP!
void stepper_forwardstep1() {
  myStepper1.onestep(FORWARD, MICROSTEP);
}
Exemplo n.º 3
0
void stepper_backwardstep1() {  
  myStepper1.onestep(BACKWARD, MICROSTEP);
}
Exemplo n.º 4
0
void stepper_reset_lp() {
  myStepper1->onestep(BACKWARD, DOUBLE);
  delayMicroseconds(300);
}
Exemplo n.º 5
0
void backwardstep() {  
	  stepper_motor.onestep(BACKWARD, DOUBLE);
}
Exemplo n.º 6
0
void forwardstep() {  
	  stepper_motor.onestep(FORWARD, DOUBLE);
}
Exemplo n.º 7
0
void backwardstep() {  
  lat_motor.onestep( BACKWARD, INTERLEAVE );
}
Exemplo n.º 8
0
void forwardstep() {  
  lat_motor.onestep( FORWARD, INTERLEAVE );
}