   }
 
   for (uint8_t v = val; v != new_val; v += incr) {
-    for (uint8_t i = 0; i < NUM_LEDS; i++) {
+    for (int i = 0; i < NUM_LEDS; i++) {
       leds[i] = CHSV(hue, 255, v);
     }
     FastLED.show();

}

void setup() {
  FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);

  for (uint8_t i = 0; i < NUM_LEDS; i++) {
    leds[i] = CHSV(hue, 255, val);
  }
}

void loop() {
  demo_pulse_count = (demo_pulse_count + 1) % DEMO_PULSES;
  fade(PULSE_MIN_VAL, PULSE_DURATION / 2);
  if (demo_pulse_count == 0) {
    fade(CHANGE_MIN_VAL, CHANGE_DURATION / 2);
    hue = (hue + 32) % 255;
    fade(PULSE_MIN_VAL, CHANGE_DURATION / 2);
  }
  fade(PULSE_MAX_VAL, PULSE_DURATION / 2);
}

// visuals
#define PULSE_MAX_VAL 255
#define PULSE_MIN_VAL 160
#define PULSE_DURATION_SLOW 3000
#define PULSE_DURATION_MED 1500
#define PULSE_DURATION_FAST 0

#define CHANGE_MIN_VAL 64
#define CHANGE_DURATION 800

// state
CRGB leds[NUM_LEDS];
uint8_t hue = HUE_RED;
uint8_t val = PULSE_MAX_VAL;
bool pulse = true;
long pulse_duration = PULSE_DURATION_FAST;



void fade(uint8_t new_val, long duration) {
  int incr;
  long delay_ms;
  if (val < new_val) {
    incr = 1;
    delay_ms = duration / (new_val - val);
