Basic stepper driving using Arduino Uno and Pololu A4988 stepper driver board

int x;

void setup() { pinMode(6,OUTPUT); // Enable pinMode(5,OUTPUT); // Step pinMode(4,OUTPUT); // Dir digitalWrite(6,LOW); // Set Enable low }

void loop() {

digitalWrite(4,HIGH); // Set Dir high

for(x = 0; x < 200; x++) // Loop 200 times { digitalWrite(5,HIGH); // Output high delayMicroseconds(500); // Wait 1/2 a ms digitalWrite(5,LOW); // Output low delayMicroseconds(500); // Wait 1/2 a ms } delay(1000); // pause one second

digitalWrite(4,LOW); // Set Dir low

for(x = 0; x < 200; x++) // Loop 2000 times { digitalWrite(5,HIGH); // Output high delayMicroseconds(500); // Wait 1/2 a ms digitalWrite(5,LOW); // Output low delayMicroseconds(500); // Wait 1/2 a ms } delay(1000); // pause one second }

Login to post a comment...

Bismo07 9 months, 2 weeks ago

thx for the tutorial

FeintNightmare 2 years, 4 months ago

thnx :)

Hunmin Koh 2 years, 5 months ago

Hunmin Koh
1.Download A4988 Stepper Motor Driver.fzpz 2.Open Fritzing, go to Mine tab. 3.Click on a drop down menu icon on the right corner, select Import. 4. Import the downloaded part file.

FeintNightmare 2 years, 5 months ago

hi can u tell me how I can use this as a part on fritzing? im new here :P