Arduino_EMBRYO_2 - StepMotor()

This function creates an instance of StepMotor Class for EMBRYO 2 that represent a linear axis of the robot. Use it at the top of your sketch, above setup() and loop().

Syntax

StepMotor(AXIS_ID,
          enablePin,
          directionPin,
          pulsePin,
          homePin,
          farPin,
          forwardPin,
          backwardPin,
          startPin,
          emergencyStopPin);

Parameters

  • AXIS_ID: motor unique ID (numeric)
  • enablePin: Pin connected to motor enable pin
  • directionPin: Pin connected to motor direction pin
  • pulsePin: Pin connected to motor pulse pin
  • homePin: Pin connected to home position endstop switch
  • farPin: Pin connected to far from home endstop switch
  • forwardPin: Pin connected to forward button
  • backwardPin: Pin connected to backward button
  • startPin: Pin connected to initialization button
  • emergencyStopPin: Pin connected to emergency stop button

Example

#include <Arduino_EMBRYO_2.h>

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


void setup() {}
void loop() {}

See also