Sets a serial timeout. When TX/S1 gets disconnected, the controller stops motion.
#include <SoftwareSerial.h>
#define TX_PIN 11
#define RX_PIN 10
SoftwareSerial SerialPort(RX_PIN, TX_PIN);
void setup()
{
SerialPort.begin(9600);
SerialPort.listen();
K1.start();
K1.serialTimeout(1000);
K1.home().wait();
}
void loop()
{
long minimum = K1.getMin().value();
K1.p(minimum).wait();
delay(250);
long maximum = K1.getMax().value();
K1.p(maximum).wait();
delay(250);
}