Arduino_EMBRYO_2 - readEndstopHome()

Returns the boolean value in the pin connected to the Endstop switch in the motor home.

Syntax

axis.readEndstopHome()

Returns

The signal of the endstop switch in motor home: LOW or HIGH.

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();
  Serial.println("Endstop Home logic");
  Serial.println("Not pressed: " + String(axis.readEndstopHome()));
  Serial.println("Pressed: " + String(!axis.readEndstopHome()));
}
void loop() {}

See also