 #define NUM_LEDS    60
 CRGB leds[NUM_LEDS];
 
+#define ARRAY_SIZE(A) (sizeof(A) / sizeof((A)[0]))
+ 
+// List of patterns to cycle through.  Each is defined as a separate function below.
+
+typedef uint8_t (*SimplePattern)();
+typedef SimplePattern SimplePatternList[];
+typedef struct { SimplePattern drawFrame;  char name[32]; } PatternAndName;
+typedef PatternAndName PatternAndNameList[];
+ 
+// These times are in seconds, but could be changed to milliseconds if desired;
+// there's some discussion further below.
+ 
+const PatternAndNameList patterns = { 
+  { rainbow,            "Rainbow" },
+  { rainbowWithGlitter, "Rainbow With Glitter" },
+  { confetti,           "Confetti" },
+  { sinelon,            "Sinelon" },
+  { bpm,                "Beat" },
+  { juggle,             "Juggle" },
+  { fire,               "Fire" },
+  { water,              "Water" },
+  { analogClock,        "Analog Clock" },
+  { fastAnalogClock,    "Fast Analog Clock Test" },
+  { showSolidColor,     "Solid Color" }
+};
+
 uint8_t brightness = 32;
 
-int patternCount = 10;
+int patternCount = ARRAY_SIZE(patterns);
 int patternIndex = 0;
 char patternName[32] = "Rainbow";
 int power = 1;

}

uint8_t fire() {
    // Add entropy to random number generator; we use a lot of it.
    random16_add_entropy(random(256));
    
    uint8_t cooling = 55;
    uint8_t sparking = 120;
    
    // Array of temperature readings at each simulation cell
    static const uint8_t fireLedCount = NUM_LEDS / 2;
    static byte heat[fireLedCount];
    
    // Step 1.  Cool down every cell a little
    for( int i = 0; i < fireLedCount; i++) {
      heat[i] = qsub8( heat[i],  random8(0, ((cooling * 10) / fireLedCount) + 2));
    }
    
    // Step 2.  Heat from each cell drifts 'up' and diffuses a little
    for( int k= fireLedCount - 1; k >= 2; k--) {
      heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;
    }
    
    // Step 3.  Randomly ignite new 'sparks' of heat near the bottom
    if( random8() < sparking ) {
      int y = random8(7);
      heat[y] = qadd8( heat[y], random8(160,255) );
    }
    
    byte colorindex = scale8(heat[0], 240);
    
    leds[fireLedCount] = ColorFromPalette(HeatColors_p, colorindex);
    
    // Step 4.  Map from heat cells to LED colors
    for( int j = 0; j < fireLedCount; j++) {
      // Scale the heat value from 0-255 down to 0-240
      // for best results with color palettes.
      colorindex = scale8(heat[j], 240);
      leds[(fireLedCount - 1) - j] = ColorFromPalette(HeatColors_p, colorindex);
      leds[(fireLedCount - 1) + j] = ColorFromPalette(HeatColors_p, colorindex);
    }
    
    colorindex = scale8(heat[fireLedCount - 1], 240);
    leds[NUM_LEDS - 1] = ColorFromPalette(HeatColors_p, colorindex);
    
    return 15;
}

int oldSecTime = 0;
int oldSec = 0;

uint8_t analogClock() {
    dimAll(220);

        brightness = 1;
    else if(brightness > 255)
        brightness = 255;
    
    FastLED.setBrightness(brightness);
    
    uint8_t timezoneSign = EEPROM.read(1);
    if(timezoneSign < 1)
