Please post your images here. You clearly know how.
Forum was not displaying the images inline from imgur.com, hence I posted the links.
Fixed it now. I needed to link to the image location with the extensions.
Code is as follows
// Arduino Digital Pins and Motor Connections
int dPin = 6; // Direction motor || HIGH - Towards the Motor || LOW - Away from the Motor
int sPin = 7; // Step Pin for providing square pulses
int wake = 9; // Sleep Pin || HIGH - Driver Enabled || LOW - Enter Sleep Mode
int M1 = 4; // Mode Pins
int M0 = 5; // Mode Pins
int enb = 8; // Enable Pin for driver || HIGH - Driver Disabled || LOW - Driver Enabled
int rst = 10; // Reset Pin for driver || HIGH - Driver Enabled || LOW - Driver Disabled
int pulsePeriod = 800; // Pulse Period for the Step Waveform
char input;
// Following parameters can be changed in the tests
int delayTime = 0; // Delay between Each Step in milliseconds
int nMoveSteps = 200; // Testing with values 100, 200, 400, 800, 1000
void stepMotor(boolean dir, int nSteps, int dirPin, int stepPin) // Input - Value for Direction Pin, Number of Steps to be moved pins, uC Pins for direction and step
{
digitalWrite(dirPin, dir); // HIGH - Towards the Motor || LOW - Away from the Motor
delayMicroseconds(2);
for (int i = 0; i < nSteps; i++)
{
digitalWrite(stepPin, HIGH);
delayMicroseconds(pulsePeriod);
digitalWrite(stepPin, LOW);
delayMicroseconds(pulsePeriod);
}
}
void setup()
{
Serial.begin(9600);
pinMode(dPin, OUTPUT);
pinMode(sPin, OUTPUT);
pinMode(wake, OUTPUT);
pinMode(enb, OUTPUT);
pinMode(M0, OUTPUT);
pinMode(M1, OUTPUT);
// Full Step Mode
digitalWrite(M0, LOW);
digitalWrite(M1, LOW);
// Half Step Mode
// digitalWrite(M0, HIGH);
// digitalWrite(M1, LOW);
// One Fourth Step Mode
// digitalWrite(M0, LOW);
// digitalWrite(M1, HIGH);
// One Eight Mode
// digitalWrite(M0, HIGH);
// digitalWrite(M1, HIGH);
digitalWrite(enb, HIGH); // Logic HIGH - Driver Disabled
digitalWrite(wake, HIGH); // Logic HIGH - Driver Enabled
digitalWrite(rst, HIGH); // Logic HIGH - Driver Enabled
digitalWrite(enb, LOW); // Logic LOW - Driver Enabled
delay(5000);
}
void loop()
{
for (int i = 0; i < nMoveSteps; i++)
{
stepMotor(HIGH, 1, dPin, sPin);
delay(delayTime); // For Delay between each step
}
delay(5000);
for (int i = 0; i < nMoveSteps; i++)
{
stepMotor(LOW, 1, dPin, sPin);
delay(delayTime); // For Delay between each step
}
while(1)
{
}
}