Arduino_EMBRYO_2 - setTotalSteps()

Sets the total steps count of the motor. The total steps is initialized with 0 and assigned with the correct number of steps during the homing procedure. But, using this function, is possible to set the total steps count without the homing procedure .

Syntax

axis.setTotalSteps(totalSteps)

Parameters

  • totalSteps: the maximum step count allowed for the motor.

Example

#include <Arduino_EMBRYO_2.h>

StepMotor axis(1, A5, 5, 6, 3, 4, A2, A1, 2, 12);

void setup() {
  Serial.begin(9600);
  while (!Serial) {};
  axis.begin();
  motor.init(false);  // Initialize the motor without homing procedure
  motor.setTotalSteps(50000); // Set the maximum steps of the motor
}
void loop() {}

See also