interrupt advice

Hi people,

i want to use interrupt when my stepper motor is moving full rotation (this take the motor about 3 sec to complete full rotation, so i have a window to use interrupt.
the only problem is that i don’t know how to do interrupt only via the code (i want the code to make interrupt when the full revolutions order is happening.
how do I do that?

include <Stepper.h>

int stepPerRev = 2048;
int motspeed = 10;
int dt =500;

Stepper myStepper (stepPerRev, 2, 3, 4, 5);
void setup() {
Serial.begin(9600);
myStepper.setSpeed(motspeed);
}

void loop() {
myStepper.step(stepPerRev);
// interupt here, when the line above happen simultaneously !!!

delay(dt);
}

Moderador
Por favor edita tu post usando etiquetas de código.
Normas del foro