   sd.ls();
 
   nextFile();
+}
+
+#ifdef DEBUG
+void printSettingsIfDebug()
+{
+  Serial.print(F("\nMode: "));
+  Serial.print(Mode);
+  Serial.print(F(" Brightness: max "));
+  Serial.print(brightness);
+  Serial.print(F(" r "));
+  Serial.print(r_intensity.floor);
+  Serial.print(F("-"));
+  Serial.print(r_intensity.ceil);
+  Serial.print(F(" g "));
+  Serial.print(g_intensity.floor);
+  Serial.print(F("-"));
+  Serial.print(g_intensity.ceil);
+  Serial.print(F(" b "));
+  Serial.print(b_intensity.floor);
+  Serial.print(F("-"));
+  Serial.print(b_intensity.ceil);
+  Serial.print(F(" neg "));
+  Serial.print(negative);
+}
+#else
+inline void printSettingsIfDebug()
+{
+}
+#endif
+
+void resetDefaultSettings()
+{
+  r_intensity.reset();
+  g_intensity.reset();
+  b_intensity.reset();
+  brightness = 255;
+  negative = 0;
 }
 
 void handleRfRemoteButtons()

  }
#endif

  switch (button_states) {
    case Pressed::a: {
      brightness -= BRIGHTNESS_STEP; // overflow to 255 at zero
#ifdef DEBUG
      Serial.print(F("\nBrightness: "));
      Serial.print(brightness);
#endif
    } break;

    case Pressed::b: {
      nextFile();
    } break;
  }
}

void nextFile()

  const int all  = abcd;
}

enum {
  NORMAL_MODE,
  COLOR_CEILING_MODE,
  COLOR_FLOOR_MODE,
  VIDEO_PLAYBACK_MODE,
  MACRO_MODE,
  MISC_MODE,
} Mode;

apa106<D, 6>   LEDstrip;
rgb frame[200];
uint8_t brightness = 255;
uint8_t negative;

struct ColorIntensity
{
  enum { MIN = 0, MAX = 8 };

  uint8_t floor = MIN;
  uint8_t ceil = MAX;

  void lowerCeil()
  {
    ceil = (ceil == floor ? MAX : ceil - 1);
  }

  void raiseFloor()
  {
    floor = (ceil == floor ? MIN : floor + 1);
  }

  void reset()
  {
    floor = MIN;
    ceil = MAX;
  }

  uint8_t minBrightness()
  {
    return map(floor, MIN, MAX, negative * brightness, !negative * brightness);
  }

  uint8_t maxBrightness()
  {
    return map(ceil, MIN, MAX, negative * brightness, !negative * brightness);
  }
};

ColorIntensity r_intensity;
ColorIntensity g_intensity;
ColorIntensity b_intensity;

// Test with reduced SPI speed for breadboards.
// Change spiSpeed to SPI_FULL_SPEED for better performance
