Moves the EMBRYO 2 educational modular machine the X and the Y carriages to a specified step count in each axis. Zero is in the motor home position and max number of steps is in the axis end far from the motor home.
robot.toStepXY(stepX, stepY)
#include <Arduino_EMBRYO_2.h>
StepMotor axisX(1, A5, 5, 6, 3, 4, A1, A2, 2, 12);
StepMotor axisY(2, A5, 10, 11, 8, 9, A3, A4, 2, 12);
Embryo robot(axisX, axisY, 2, 12);
unsigned long stepNumX = 0, stepNumY = 0;
void setup() {
Serial.begin(115200);
while (!Serial) {};
robot.begin();
Serial.println("Press the Start Button to start the machine");
while(!robot.ready());
}
void loop() {
Serial.println("Enter the number of the step for X-axis: ");
while((Serial.available() <= 0)){};
stepNumX = Serial.parseInt();
Serial.println("Enter the number of the step for Y-axis: ");
while((Serial.available() <= 0)){};
stepNumY = Serial.parseInt();
robot.toStepXY(stepNumX, stepNumY);
}