A4988 Proteus Library -

// Pin Definitions const int stepPin = 3; const int dirPin = 4; void setup() // Configure pins as Outputs pinMode(stepPin, OUTPUT); pinMode(dirPin, OUTPUT); void loop() // Set direction to Clockwise digitalWrite(dirPin, HIGH); // Rotate 200 pulses (1 full revolution in Full Step mode) for(int x = 0; x < 200; x++) digitalWrite(stepPin, HIGH); delayMicroseconds(1000); // Determines speed digitalWrite(stepPin, LOW); delayMicroseconds(1000); delay(1000); // Wait one second // Change direction to Counter-Clockwise digitalWrite(dirPin, LOW); // Rotate 200 pulses back for(int x = 0; x < 200; x++) digitalWrite(stepPin, HIGH); delayMicroseconds(1000); digitalWrite(stepPin, LOW); delayMicroseconds(1000); delay(1000); // Wait one second Use code with caution. Simulating the Code:

At its core, the library is a virtual replica of the popular A4988 stepper motor driver carrier board. It is a simulation model designed to run within (specifically ISIS for schematic capture and VSM for simulation). a4988 proteus library

: Arduino Uno (Requires the Arduino Proteus Library) or PIC Microcontroller. Motor Driver : The newly added A4988 block. // Pin Definitions const int stepPin = 3;