#define DIR_PIN 10 #define STEP_PIN 11 #define EN_PIN 15 // #define MS1 14 // #define MS2 13 void setup() { // put your setup code here, to run once: Serial.begin(115200); //step pin pinMode(10, OUTPUT); //direction pin pinMode(11, OUTPUT); digitalWrite(11, HIGH); //enable pin pinMode(15, OUTPUT); digitalWrite(15, LOW); //reading from the potentiometer //pinMode(26,INPUT); } void loop() { // put your main code here, to run repeatedly: oneStep(); delayMicroseconds(4000); //int potentiometer = analogRead(26); // Serial.println(potentiometer); //delay(1); } void oneStep() { digitalWrite(STEP_PIN, HIGH); delayMicroseconds(1); digitalWrite(STEP_PIN, LOW); delayMicroseconds(50); }