I think it would work if you synchronized the LED loop with the interrupt. By re-starting the LED timer with each interrupt you should be able to keep the blinking locked to the position of the platter. Something like this:
int leds=8; //Led strip on pin 8, connect to 12v from ATX trough ULN2003
unsigned long tiempoAnterior = 0;
volatile unsigned long tiempoLeds = 0;
unsigned long tiempoVuelta=0;
volatile unsigned long vueltas=0;
int ledState=LOW;
void setup()
{
attachInterrupt(0, rpm_fun, FALLING); //interrupt 0 -> pin 2
}
void loop()
{
unsigned long tiempoActual = micros();
if(vueltas>=20)
{
tiempoVuelta = (tiempoActual-tiempoAnterior) / vueltas; //Each turn takes aproximately 8310 uS
tiempoAnterior = tiempoActual;
vueltas=0;
}
if(tiempoActual-tiempoLeds >= (tiempoVuelta/4)) //tiempoVuelta/4 -> Split each revolution time into 4
{
tiempoLeds=tiempoActual; //Last time Leds blinked
ledState = !ledState;
digitalWrite(leds, ledState);
}
}
void rpm_fun()
{
vueltas++;
tiempoLeds = micros();
}