 #include <Adafruit_NeoPixel.h>
-#include <algorithm>
 #ifdef __AVR__
 #include <avr/power.h>
 #endif

  for (int i = 0; i < strip.numPixels(); i++) {
    int rgb = i % 5;
    switch (rgb) {
      case 0:
        colors[i] = strip.Color(255, 0, 0);
        break;
      case 1:
        colors[i] = strip.Color(0, 255, 0);
        break;
      case 2:
        colors[i] = strip.Color(0, 0, 255);
        break;
      case 3:
        colors[i] = strip.Color(255, 255, 0);
        break;
      case 4:
        colors[i] = strip.Color(0, 255, 255);
        break;
    }
  }
}

void simUpsideDownTouch(uint8_t pixel) {
  for (uint8_t fade = 0; fade < FPS; fade++) {
    int brightness = fade;
    strip.setPixelColor(pixel, colors[pixel]);
    strip.show();
    delay(FADE_TIME);
  }

  for (uint8_t fade = FPS; fade > 0; fade--) {
    int brightness = fade;
    strip.setPixelColor(pixel, colors[pixel]);
    strip.show();
    delay(FADE_TIME);
  }
}

  distance = (duration / 2) * 0.0344;

  int8_t pixel = floor(distance) / TUNING;

  colorWipe(pixel);
  simUpsideDownPresence(pixel);
}

void colorWipe(uint8_t pixel) {
  for (uint8_t i = 0; i < strip.numPixels(); i++) {
    strip.setPixelColor(i, 0);
  }
}

