// https://www.reddit.com/r/FastLED/comments/1fbrnaz/stroboscopic_effect/

#include <FastLED.h>

#define NUM_LEDS 8

CRGB leds[NUM_LEDS];

void setup() {
  FastLED.addLeds<WS2812B, 3, GRB>(leds, NUM_LEDS);
  FastLED.clear(true);
}

void loop() {
  // calculate how many microseconds between flashes for
  // a given RPM
  const int rpm = 260;
  const uint64_t rpm_us = 60000000 / rpm;

  // give the briefest possible flash
  FastLED.showColor(CRGB::White);
  FastLED.showColor(CRGB::Black);

  // when should the next flash happen?
  static uint64_t next_flash_us = 0;
  if ((next_flash_us += rpm_us) < micros())
    next_flash_us = micros();

  // wait until the next flash is due
  while (const uint64_t delay_us = next_flash_us - micros() < rpm_us)
    delayMicroseconds(delay_us);
}