/*
Stepper Motor Tester v1 @Kunal Panchal
Board - Arduino Uno R3
Test motor - Stepper motor from 0.1 - 10 Amps
Driver everelettronica LW3D2030N2A1 & LW3D3070N0A1
*/
//Define Pins
int driverPLS = 9; // PLS- pin
int driverDIR = 10; // DIR- pin
int Count = 0;
void setup() {
pinMode (driverPLS, OUTPUT);
pinMode (driverDIR, OUTPUT);
}
void CW (){
digitalWrite(driverDIR,HIGH); //Direction Signal
digitalWrite(driverPLS,HIGH); //Pulse Signal 1
delayMicroseconds(500);
digitalWrite(driverPLS,LOW); //Pulse Signal 0
delayMicroseconds(500);
}
void CCW (){
digitalWrite(driverDIR,LOW); //Direction Signal
digitalWrite(driverPLS,HIGH); //Pulse Signal 1
delayMicroseconds(500);
digitalWrite(driverPLS,LOW); //Pulse Signal 0
delayMicroseconds(500);
}
void loop() {
while (Count <= 30000){ //Number of Pulse for Clockwise Rotation
CW();
Count++;
}
Count = 0;
delay(1000);
while (Count <= 30000){ //Number of Pulse for CounterClockwise Rotation
CCW();
Count++;
}
Count = 0;
delay(1000);
}