const int dirPin = 16; //Este es el GPIO16 driver2 const int stepPin = 17; //Este es el GPIO17 driver2 const int enablePin = 4; //este es el GPIO4 driver2 int stepDelay=8000; int n=1000; void setup() { // put your setup code here, to run once: pinMode(dirPin, OUTPUT); // pin Dir2 como salida pinMode(stepPin, OUTPUT); // pin Step2 como salida digitalWrite(enablePin, HIGH); // pin enable2 como salida } void loop() { // put your main code here, to run repeatedly: digitalWrite(dirPin, HIGH); digitalWrite(enablePin, LOW); // Giramos 200 pulsos para hacer una vuelta completa for (int x = 0; x < n; x++) { digitalWrite(stepPin, HIGH); delayMicroseconds(stepDelay); digitalWrite(stepPin, LOW); delayMicroseconds(stepDelay); } digitalWrite(enablePin, HIGH); delay(5000); }