Moves back and forth, demonstrating position commands streamed at high speed.
#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.home().wait();
}
void loop()
{
long minimum = K1.getMin().value();
long maximum = K1.getMax().value();
K1.p(minimum).wait();
K1.streaming(true);
for (long position = minimum; position <= maximum; position ++)
{
K1.p(position);
}
for (long position = maximum; position >= minimum; position --)
{
K1.p(position);
}
K1.streaming(false);
K1.p(minimum).wait();
}