Running both sensor and addressable LED strips at a same time?
Rewrite without using delay(). Or alternatively, do the test inside the for loop as well, eg.

void rainbowCycle(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j&lt;256*5; j++) { // 5 cycles of all colors on wheel
    for(i=0; i&lt; strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) &amp; 255));
    }
    strip.show();
    delay(wait);

    // ----------- ADD THESE THREE LINES ---------------
    currentSensorReading = analogRead(sensorPin);
    if(currentSensorReading is NOT in range of certain values)
        return;

  }
}