hello, I'm new to stepper motor and I'm using quad stepper driver by spark fun (https://www.sparkfun.com/products/10507). I can't somehow happen to stop the motor. I'm trying to stop by sending a stop signal to the enable pin 22 by setting it low. does that even happen? Can anyone help me with that issue. The motor is pulolu stepper https://www.pololu.com/product/2267 and I'm using arduino mega2560. The library used is sparkfunquadstep.h.
Thanks
#include <SparkFunQuadstep.h>
int i;
int Distance;
quadstep quadstep;
void setup() {
//quadstep.motor_pins(1,A1,36,A8,A9,A10); //ch 1
//quadstep.motor_pins(2,10,9,8,7,4); //ch 2
quadstep.motor_pins(3,22,23,24,25,26); //ch 3
//quadstep.motor_pins(4,27,28,29,30,31); //ch 4
}
void loop() {
quadstep.motor_go(3,1,-50,2);//step motor 3
Distance = Distance+1;
i==digitalRead(Distance);
delay(500);
if (i=1)
{
digitalWrite(22,LOW);
}
delay(500);
}