So I recently purchased a G723-400-4 Geckodrive motor and a G213V Digital Step Drive from Geckodrive also. Now the G213V calls for a step input, direction input, and a ground. I looked at a few libraries that people recommended but I just can't seem to get it to work. Does anyone have a sketch written that they've used to control a Gecko Stepper Driver before? Just so I can test it and start to understand how it works?
From what i've read Pin 1 would be the steps, Pin 2 would be direction, and GND would be my common it's just the code I can't seem to figure out.
Assuming it takes 5v signals that are compatible with the Arduino I/O pins then the AccelStepper library should work fine. You need to initialize your AccelStepper instance as DRIVER.
You should not use Arduino pins 0 and 1 as they are used for serial communication.
This simple code should also work (assuming you match the pins to the driver)
// testing a stepper motor with a Pololu A4988 driver board or equivalent
// on an Uno the onboard led will flash with each step
// as posted on Arduino Forum at http://forum.arduino.cc/index.php?topic=208905.0
byte directionPin = 6;
byte stepPin = 5;
int numberOfSteps = 100;
byte ledPin = 13;
int pulseWidthMicros = 20; // microseconds
int millisbetweenSteps = 25; // milliseconds
void setup()
{
Serial.begin(9600);
Serial.println("Starting StepperTest");
digitalWrite(ledPin, LOW);
delay(2000);
pinMode(directionPin, OUTPUT);
pinMode(stepPin, OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(directionPin, HIGH);
for(int n = 0; n < numberOfSteps; n++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(pulseWidthMicros);
digitalWrite(stepPin, LOW);
delay(millisbetweenSteps);
digitalWrite(ledPin, !digitalRead(ledPin));
}
delay(3000);
digitalWrite(directionPin, LOW);
for(int n = 0; n < numberOfSteps; n++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(pulseWidthMicros);
digitalWrite(stepPin, LOW);
delay(millisbetweenSteps);
digitalWrite(ledPin, !digitalRead(ledPin));
}
}
void loop()
{
}
...R