[
  {
    "path": "Groups.yaml",
    "content": "##Example Group\r\n\r\ngroup:\r\n  houseLights:\r\n    name: Holiday Lights\r\n    control: hidden\r\n    entities:    \r\n      - light.holiday_lights\r\n      - light.color_1\r\n      - light.color_2\r\n      - light.color_3\r\n      - light.glitter\r\n      - light.lightning\r\n      - sensor.current_led\r\n\r\n##Example Lovelace\r\n\r\n    cards:\r\n      - type: entities\r\n        title: Holiday Lights\r\n        show_header_toggle: false\r\n        entities:    \r\n          - light.holiday_lights\r\n          - light.color_1\r\n          - light.color_2\r\n          - light.color_3\r\n          - light.glitter\r\n          - light.lightning\r\n          - sensor.current_led"
  },
  {
    "path": "Holiday_LED_2.0_6_Zones.ino",
    "content": "/*****************  NEEDED TO MAKE NODEMCU WORK ***************************/\r\n#define FASTLED_INTERRUPT_RETRY_COUNT 0\r\n#define FASTLED_ESP8266_RAW_PIN_ORDER\r\n\r\n/******************  LIBRARY SECTION *************************************/\r\n\r\n#include <FastLED.h>        //https://github.com/FastLED/FastLED\r\n#include <SimpleTimer.h>    //https://github.com/thehookup/Simple-Timer-Library\r\n#include <PubSubClient.h>   //https://github.com/knolleary/pubsubclient\r\n#include <ESP8266WiFi.h>    //if you get an error here you need to install the ESP8266 board manager \r\n#include <ESP8266mDNS.h>    //if you get an error here you need to install the ESP8266 board manager \r\n#include <ArduinoOTA.h>     //ArduinoOTA is now included with the ArduinoIDE\r\n\r\n/*****************  START USER CONFIG SECTION *********************************/\r\n/*****************  START USER CONFIG SECTION *********************************/\r\n/*****************  START USER CONFIG SECTION *********************************/\r\n/*****************  START USER CONFIG SECTION *********************************/\r\n\r\n#define USER_SSID                 \"YOUR_WIRELESS_SSID\"\r\n#define USER_PASSWORD             \"YOUR_WIRELESS_PW\"\r\n#define USER_MQTT_SERVER          \"YOUR_MQTT_SERVER_ADDRESS\"\r\n#define USER_MQTT_PORT            1883\r\n#define USER_MQTT_USERNAME        \"YOUR_MQTT_USERNAME\"\r\n#define USER_MQTT_PASSWORD        \"YOUR_MQTT_PASSWORD\"\r\n#define USER_MQTT_CLIENT_NAME     \"LightMCU\"           // Used to define MQTT topics, MQTT Client ID, and ArduinoOTA\r\n\r\n\r\n#define ZONEONE                         1                   //ZONEONE is pin D1, 1 = zone used 0 = zone unused\r\n#define FIRSTZONE_SECTIONS              1                   //Number of roof sections setup below\r\n#define FIRSTZONE_LEDS                  300                 //Number of LEDS in this zone \r\n#define FIRSTZONE_COLOR_ORDER           GRB                 //Color orders, can be RGB, RBG, GRB, GBR, BRG, BGR \r\n\r\n#define ZONETWO                         1                   //ZONETWO is pin D2, 1 = zone used 0 = zone unused\r\n#define SECONDZONE_SECTIONS             1                   //Number of roof sections setup below\r\n#define SECONDZONE_LEDS                 300                 //Number of LEDS in this zone \r\n#define SECONDZONE_COLOR_ORDER          GRB                 //Color orders, can be RGB, RBG, GRB, GBR, BRG, BGR \r\n\r\n#define ZONETHREE                       1                   //ZONETHREE is pin D3, 1 = zone used 0 = zone unused\r\n#define THIRDZONE_SECTIONS              1                   //Number of roof sections setup below\r\n#define THIRDZONE_LEDS                  300                 //Number of LEDS in this zone \r\n#define THIRDZONE_COLOR_ORDER           GRB                 //Color orders, can be RGB, RBG, GRB, GBR, BRG, BGR \r\n\r\n#define ZONEFOUR                        1                   //ZONEFOUR is pin D5, 1 = zone used 0 = zone unused\r\n#define FOURTHZONE_SECTIONS             1                   //Number of roof sections setup below\r\n#define FOURTHZONE_LEDS                 300                 //Number of LEDS in this zone \r\n#define FOURTHZONE_COLOR_ORDER          GRB                 //Color orders, can be RGB, RBG, GRB, GBR, BRG, BGR \r\n\r\n#define ZONEFIVE                        1                   //ZONEFIVE is pin D6, 1 = zone used 0 = zone unused\r\n#define FIFTHZONE_SECTIONS              1                   //Number of roof sections setup below\r\n#define FIFTHZONE_LEDS                  300                 //Number of LEDS in this zone \r\n#define FIFTHZONE_COLOR_ORDER           GRB                 //Color orders, can be RGB, RBG, GRB, GBR, BRG, BGR\r\n\r\n#define ZONESIX                         1                   //ZONESIX is pin D7, 1 = zone used 0 = zone unused\r\n#define SIXTHZONE_SECTIONS              1                   //Number of roof sections setup below\r\n#define SIXTHZONE_LEDS                  300                 //Number of LEDS in this zone \r\n#define SIXTHZONE_COLOR_ORDER           GRB                 //Color orders, can be RGB, RBG, GRB, GBR, BRG, BGR \r\n\r\n/*****************************    ZONEONE ROOF SETUP    *************************************/\r\n/*****************************    ZONEONE ROOF SETUP    *************************************/\r\n\r\n#if  FIRSTZONE_SECTIONS >= 1        \r\n#define ZONEONE_SECTION1_START            0           //starting LED for this zone\r\n#define ZONEONE_SECTION1_END              100         //ending LED for this zone\r\n#define ZONEONE_SECTION1_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEONE_SECTION1_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIRSTZONE_SECTIONS >= 2\r\n#define ZONEONE_SECTION2_START            0           //starting LED for this zone\r\n#define ZONEONE_SECTION2_END              100         //ending LED for this zone\r\n#define ZONEONE_SECTION2_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEONE_SECTION2_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIRSTZONE_SECTIONS >= 3\r\n#define ZONEONE_SECTION3_START            0           //starting LED for this zone\r\n#define ZONEONE_SECTION3_END              100         //ending LED for this zone\r\n#define ZONEONE_SECTION3_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEONE_SECTION3_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIRSTZONE_SECTIONS >= 4\r\n#define ZONEONE_SECTION4_START            0           //starting LED for this zone\r\n#define ZONEONE_SECTION4_END              100         //ending LED for this zone\r\n#define ZONEONE_SECTION4_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEONE_SECTION4_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIRSTZONE_SECTIONS >= 5\r\n#define ZONEONE_SECTION5_START            0           //starting LED for this zone\r\n#define ZONEONE_SECTION5_END              100         //ending LED for this zone\r\n#define ZONEONE_SECTION5_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEONE_SECTION5_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIRSTZONE_SECTIONS >= 6\r\n#define ZONEONE_SECTION6_START            0           //starting LED for this zone\r\n#define ZONEONE_SECTION6_END              100         //ending LED for this zone\r\n#define ZONEONE_SECTION6_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEONE_SECTION6_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIRSTZONE_SECTIONS >= 7\r\n#define ZONEONE_SECTION7_START            0          //starting LED for this zone\r\n#define ZONEONE_SECTION7_END              100        //ending LED for this zone\r\n#define ZONEONE_SECTION7_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEONE_SECTION7_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIRSTZONE_SECTIONS >= 8\r\n#define ZONEONE_SECTION8_START            0          //starting LED for this zone\r\n#define ZONEONE_SECTION8_END              100        //ending LED for this zone\r\n#define ZONEONE_SECTION8_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEONE_SECTION8_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIRSTZONE_SECTIONS >= 9\r\n#define ZONEONE_SECTION9_START            0          //starting LED for this zone\r\n#define ZONEONE_SECTION9_END              100        //ending LED for this zone\r\n#define ZONEONE_SECTION9_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEONE_SECTION9_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n/*****************************    ZONETWO ROOF SETUP    *************************************/\r\n/*****************************    ZONETWO ROOF SETUP    *************************************/\r\n\r\n#if  SECONDZONE_SECTIONS >= 1        \r\n#define ZONETWO_SECTION1_START            0           //starting LED for this zone\r\n#define ZONETWO_SECTION1_END              44         //ending LED for this zone\r\n#define ZONETWO_SECTION1_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETWO_SECTION1_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SECONDZONE_SECTIONS >= 2\r\n#define ZONETWO_SECTION2_START            44           //starting LED for this zone\r\n#define ZONETWO_SECTION2_END              87         //ending LED for this zone\r\n#define ZONETWO_SECTION2_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETWO_SECTION2_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SECONDZONE_SECTIONS >= 3\r\n#define ZONETWO_SECTION3_START            88           //starting LED for this zone\r\n#define ZONETWO_SECTION3_END              94         //ending LED for this zone\r\n#define ZONETWO_SECTION3_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETWO_SECTION3_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SECONDZONE_SECTIONS >= 4\r\n#define ZONETWO_SECTION4_START            95           //starting LED for this zone\r\n#define ZONETWO_SECTION4_END              182         //ending LED for this zone\r\n#define ZONETWO_SECTION4_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETWO_SECTION4_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SECONDZONE_SECTIONS >= 5\r\n#define ZONETWO_SECTION5_START            183           //starting LED for this zone\r\n#define ZONETWO_SECTION5_END              189         //ending LED for this zone\r\n#define ZONETWO_SECTION5_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETWO_SECTION5_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SECONDZONE_SECTIONS >= 6\r\n#define ZONETWO_SECTION6_START            190           //starting LED for this zone\r\n#define ZONETWO_SECTION6_END              286         //ending LED for this zone\r\n#define ZONETWO_SECTION6_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETWO_SECTION6_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SECONDZONE_SECTIONS >= 7\r\n#define ZONETWO_SECTION7_START            287          //starting LED for this zone\r\n#define ZONETWO_SECTION7_END              382        //ending LED for this zone\r\n#define ZONETWO_SECTION7_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETWO_SECTION7_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SECONDZONE_SECTIONS >= 8\r\n#define ZONETWO_SECTION8_START            0          //starting LED for this zone\r\n#define ZONETWO_SECTION8_END              100        //ending LED for this zone\r\n#define ZONETWO_SECTION8_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETWO_SECTION8_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SECONDZONE_SECTIONS >= 9\r\n#define ZONETWO_SECTION9_START            0          //starting LED for this zone\r\n#define ZONETWO_SECTION9_END              100        //ending LED for this zone\r\n#define ZONETWO_SECTION9_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETWO_SECTION9_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n\r\n/*****************************    ZONETHREE ROOF SETUP    *************************************/\r\n/*****************************    ZONETHREE ROOF SETUP    *************************************/\r\n\r\n#if  THIRDZONE_SECTIONS >= 1        \r\n#define ZONETHREE_SECTION1_START            0           //starting LED for this zone\r\n#define ZONETHREE_SECTION1_END              100         //ending LED for this zone\r\n#define ZONETHREE_SECTION1_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETHREE_SECTION1_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  THIRDZONE_SECTIONS >= 2\r\n#define ZONETHREE_SECTION2_START            0           //starting LED for this zone\r\n#define ZONETHREE_SECTION2_END              100         //ending LED for this zone\r\n#define ZONETHREE_SECTION2_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETHREE_SECTION2_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  THIRDZONE_SECTIONS >= 3\r\n#define ZONETHREE_SECTION3_START            0           //starting LED for this zone\r\n#define ZONETHREE_SECTION3_END              100         //ending LED for this zone\r\n#define ZONETHREE_SECTION3_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETHREE_SECTION3_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  THIRDZONE_SECTIONS >= 4\r\n#define ZONETHREE_SECTION4_START            0           //starting LED for this zone\r\n#define ZONETHREE_SECTION4_END              100         //ending LED for this zone\r\n#define ZONETHREE_SECTION4_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETHREE_SECTION4_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  THIRDZONE_SECTIONS >= 5\r\n#define ZONETHREE_SECTION5_START            0           //starting LED for this zone\r\n#define ZONETHREE_SECTION5_END              100         //ending LED for this zone\r\n#define ZONETHREE_SECTION5_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETHREE_SECTION5_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  THIRDZONE_SECTIONS >= 6\r\n#define ZONETHREE_SECTION6_START            0           //starting LED for this zone\r\n#define ZONETHREE_SECTION6_END              100         //ending LED for this zone\r\n#define ZONETHREE_SECTION6_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETHREE_SECTION6_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  THIRDZONE_SECTIONS >= 7\r\n#define ZONETHREE_SECTION7_START            0          //starting LED for this zone\r\n#define ZONETHREE_SECTION7_END              100        //ending LED for this zone\r\n#define ZONETHREE_SECTION7_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETHREE_SECTION7_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  THIRDZONE_SECTIONS >= 8\r\n#define ZONETHREE_SECTION8_START            0          //starting LED for this zone\r\n#define ZONETHREE_SECTION8_END              100        //ending LED for this zone\r\n#define ZONETHREE_SECTION8_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETHREE_SECTION8_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  THIRDZONE_SECTIONS >= 9\r\n#define ZONETHREE_SECTION9_START            0          //starting LED for this zone\r\n#define ZONETHREE_SECTION9_END              100        //ending LED for this zone\r\n#define ZONETHREE_SECTION9_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONETHREE_SECTION9_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n/*****************************    ZONEFOUR ROOF SETUP    *************************************/\r\n/*****************************    ZONEFOUR ROOF SETUP    *************************************/\r\n\r\n#if  FOURTHZONE_SECTIONS >= 1        \r\n#define ZONEFOUR_SECTION1_START            0           //starting LED for this zone\r\n#define ZONEFOUR_SECTION1_END              100         //ending LED for this zone\r\n#define ZONEFOUR_SECTION1_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFOUR_SECTION1_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FOURTHZONE_SECTIONS >= 2\r\n#define ZONEFOUR_SECTION2_START            0           //starting LED for this zone\r\n#define ZONEFOUR_SECTION2_END              100         //ending LED for this zone\r\n#define ZONEFOUR_SECTION2_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFOUR_SECTION2_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FOURTHZONE_SECTIONS >= 3\r\n#define ZONEFOUR_SECTION3_START            0           //starting LED for this zone\r\n#define ZONEFOUR_SECTION3_END              100         //ending LED for this zone\r\n#define ZONEFOUR_SECTION3_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFOUR_SECTION3_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FOURTHZONE_SECTIONS >= 4\r\n#define ZONEFOUR_SECTION4_START            0           //starting LED for this zone\r\n#define ZONEFOUR_SECTION4_END              100         //ending LED for this zone\r\n#define ZONEFOUR_SECTION4_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFOUR_SECTION4_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FOURTHZONE_SECTIONS >= 5\r\n#define ZONEFOUR_SECTION5_START            0           //starting LED for this zone\r\n#define ZONEFOUR_SECTION5_END              100         //ending LED for this zone\r\n#define ZONEFOUR_SECTION5_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFOUR_SECTION5_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FOURTHZONE_SECTIONS >= 6\r\n#define ZONEFOUR_SECTION6_START            0           //starting LED for this zone\r\n#define ZONEFOUR_SECTION6_END              100         //ending LED for this zone\r\n#define ZONEFOUR_SECTION6_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFOUR_SECTION6_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FOURTHZONE_SECTIONS >= 7\r\n#define ZONEFOUR_SECTION7_START            0          //starting LED for this zone\r\n#define ZONEFOUR_SECTION7_END              100        //ending LED for this zone\r\n#define ZONEFOUR_SECTION7_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFOUR_SECTION7_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FOURTHZONE_SECTIONS >= 8\r\n#define ZONEFOUR_SECTION8_START            0          //starting LED for this zone\r\n#define ZONEFOUR_SECTION8_END              100        //ending LED for this zone\r\n#define ZONEFOUR_SECTION8_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFOUR_SECTION8_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FOURTHZONE_SECTIONS >= 9\r\n#define ZONEFOUR_SECTION9_START            0          //starting LED for this zone\r\n#define ZONEFOUR_SECTION9_END              100        //ending LED for this zone\r\n#define ZONEFOUR_SECTION9_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFOUR_SECTION9_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n\r\n/*****************************    ZONEFIVE ROOF SETUP    *************************************/\r\n/*****************************    ZONEFIVE ROOF SETUP    *************************************/\r\n\r\n#if  FIFTHZONE_SECTIONS >= 1        \r\n#define ZONEFIVE_SECTION1_START            0           //starting LED for this zone\r\n#define ZONEFIVE_SECTION1_END              100         //ending LED for this zone\r\n#define ZONEFIVE_SECTION1_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFIVE_SECTION1_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIFTHZONE_SECTIONS >= 2\r\n#define ZONEFIVE_SECTION2_START            0           //starting LED for this zone\r\n#define ZONEFIVE_SECTION2_END              100         //ending LED for this zone\r\n#define ZONEFIVE_SECTION2_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFIVE_SECTION2_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIFTHZONE_SECTIONS >= 3\r\n#define ZONEFIVE_SECTION3_START            0           //starting LED for this zone\r\n#define ZONEFIVE_SECTION3_END              100         //ending LED for this zone\r\n#define ZONEFIVE_SECTION3_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFIVE_SECTION3_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIFTHZONE_SECTIONS >= 4\r\n#define ZONEFIVE_SECTION4_START            0           //starting LED for this zone\r\n#define ZONEFIVE_SECTION4_END              100         //ending LED for this zone\r\n#define ZONEFIVE_SECTION4_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFIVE_SECTION4_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIFTHZONE_SECTIONS >= 5\r\n#define ZONEFIVE_SECTION5_START            0           //starting LED for this zone\r\n#define ZONEFIVE_SECTION5_END              100         //ending LED for this zone\r\n#define ZONEFIVE_SECTION5_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFIVE_SECTION5_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIFTHZONE_SECTIONS >= 6\r\n#define ZONEFIVE_SECTION6_START            0           //starting LED for this zone\r\n#define ZONEFIVE_SECTION6_END              100         //ending LED for this zone\r\n#define ZONEFIVE_SECTION6_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFIVE_SECTION6_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIFTHZONE_SECTIONS >= 7\r\n#define ZONEFIVE_SECTION7_START            0          //starting LED for this zone\r\n#define ZONEFIVE_SECTION7_END              100        //ending LED for this zone\r\n#define ZONEFIVE_SECTION7_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFIVE_SECTION7_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIFTHZONE_SECTIONS >= 8\r\n#define ZONEFIVE_SECTION8_START            0          //starting LED for this zone\r\n#define ZONEFIVE_SECTION8_END              100        //ending LED for this zone\r\n#define ZONEFIVE_SECTION8_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFIVE_SECTION8_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  FIFTHZONE_SECTIONS >= 9\r\n#define ZONEFIVE_SECTION9_START            0          //starting LED for this zone\r\n#define ZONEFIVE_SECTION9_END              100        //ending LED for this zone\r\n#define ZONEFIVE_SECTION9_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONEFIVE_SECTION9_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n\r\n/*****************************    ZONESIX ROOF SETUP    *************************************/\r\n/*****************************    ZONESIX ROOF SETUP    *************************************/\r\n\r\n#if  SIXTHZONE_SECTIONS >= 1        \r\n#define ZONESIX_SECTION1_START            0           //starting LED for this zone\r\n#define ZONESIX_SECTION1_END              100         //ending LED for this zone\r\n#define ZONESIX_SECTION1_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONESIX_SECTION1_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SIXTHZONE_SECTIONS >= 2\r\n#define ZONESIX_SECTION2_START            0           //starting LED for this zone\r\n#define ZONESIX_SECTION2_END              100         //ending LED for this zone\r\n#define ZONESIX_SECTION2_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONESIX_SECTION2_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SIXTHZONE_SECTIONS >= 3\r\n#define ZONESIX_SECTION3_START            0           //starting LED for this zone\r\n#define ZONESIX_SECTION3_END              100         //ending LED for this zone\r\n#define ZONESIX_SECTION3_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONESIX_SECTION3_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SIXTHZONE_SECTIONS >= 4\r\n#define ZONESIX_SECTION4_START            0           //starting LED for this zone\r\n#define ZONESIX_SECTION4_END              100         //ending LED for this zone\r\n#define ZONESIX_SECTION4_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONESIX_SECTION4_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SIXTHZONE_SECTIONS >= 5\r\n#define ZONESIX_SECTION5_START            0           //starting LED for this zone\r\n#define ZONESIX_SECTION5_END              100         //ending LED for this zone\r\n#define ZONESIX_SECTION5_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONESIX_SECTION5_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SIXTHZONE_SECTIONS >= 6\r\n#define ZONESIX_SECTION6_START            0           //starting LED for this zone\r\n#define ZONESIX_SECTION6_END              100         //ending LED for this zone\r\n#define ZONESIX_SECTION6_START_FIRE       1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONESIX_SECTION6_END_FIRE         1           //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SIXTHZONE_SECTIONS >= 7\r\n#define ZONESIX_SECTION7_START            0          //starting LED for this zone\r\n#define ZONESIX_SECTION7_END              100        //ending LED for this zone\r\n#define ZONESIX_SECTION7_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONESIX_SECTION7_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SIXTHZONE_SECTIONS >= 8\r\n#define ZONESIX_SECTION8_START            0          //starting LED for this zone\r\n#define ZONESIX_SECTION8_END              100        //ending LED for this zone\r\n#define ZONESIX_SECTION8_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONESIX_SECTION8_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n#if  SIXTHZONE_SECTIONS >= 9\r\n#define ZONESIX_SECTION9_START            0          //starting LED for this zone\r\n#define ZONESIX_SECTION9_END              100        //ending LED for this zone\r\n#define ZONESIX_SECTION9_START_FIRE       1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#define ZONESIX_SECTION9_END_FIRE         1          //would you like fire to begin from this point? 0 = no 1 = yes\r\n#endif\r\n\r\n\r\n/*****************  END USER CONFIG SECTION *********************************/\r\n/*****************  END USER CONFIG SECTION *********************************/\r\n/*****************  END USER CONFIG SECTION *********************************/\r\n/*****************  END USER CONFIG SECTION *********************************/\r\n/*****************  END USER CONFIG SECTION *********************************/\r\n\r\n/***********************  WIFI AND MQTT SETUP *****************************/\r\n/***********************  DON'T CHANGE THIS INFO *****************************/\r\n\r\nconst char* ssid = USER_SSID ; \r\nconst char* password = USER_PASSWORD ;\r\nconst char* mqtt_server = USER_MQTT_SERVER ;\r\nconst int mqtt_port = USER_MQTT_PORT ;\r\nconst char *mqtt_user = USER_MQTT_USERNAME ;\r\nconst char *mqtt_pass = USER_MQTT_PASSWORD ;\r\nconst char *mqtt_client_name = USER_MQTT_CLIENT_NAME ; \r\n\r\n/*****************  DECLARATIONS  ****************************************/\r\nWiFiClient espClient;\r\nPubSubClient client(espClient);\r\nSimpleTimer timer;\r\n\r\n#if ZONEONE == 1\r\nCRGB firstZone[FIRSTZONE_LEDS];\r\nconst int Pin_firstZone = 5; //marked as D1 on the board\r\nint center_firstZone = 0;\r\nint step_firstZone = -1;\r\nint previousLED_firstZone = 0;\r\n#endif\r\n\r\n#if ZONETWO == 1\r\nCRGB secondZone[SECONDZONE_LEDS];\r\nconst int Pin_secondZone = 4; //marked as D2 on the board\r\nint center_secondZone = 0;\r\nint step_secondZone = -1;\r\nint previousLED_secondZone = 0;\r\n#endif\r\n\r\n#if ZONETHREE == 1\r\nCRGB thirdZone[THIRDZONE_LEDS];\r\nconst int Pin_thirdZone = 0; //marked as D3 on the board\r\nint center_thirdZone = 0;\r\nint step_thirdZone = -1;\r\nint previousLED_thirdZone = 0;\r\n#endif\r\n\r\n#if ZONEFOUR == 1\r\nCRGB fourthZone[FOURTHZONE_LEDS];\r\nconst int Pin_fourthZone = 14; //marked as D5 on the board\r\nint center_fourthZone = 0;\r\nint step_fourthZone = -1;\r\nint previousLED_fourthZone = 0;\r\n#endif\r\n\r\n#if ZONEFIVE == 1\r\nCRGB fifthZone[FIFTHZONE_LEDS];\r\nconst int Pin_fifthZone = 12; //marked as D6 on the board\r\nint center_fifthZone = 0;\r\nint step_fifthZone = -1;\r\nint previousLED_fifthZone = 0;\r\n#endif\r\n\r\n#if ZONESIX == 1\r\nCRGB sixthZone[SIXTHZONE_LEDS];\r\nconst int Pin_sixthZone = 13; //marked as D7 on the board\r\nint center_sixthZone = 0;\r\nint step_sixthZone = -1;\r\nint previousLED_sixthZone = 0;\r\n#endif\r\n\r\n\r\n\r\n/*****************  GENERAL VARIABLES  *************************************/\r\n\r\nCRGBPalette16 gPal;\r\nint glitterFrequency = 100;\r\nint lightningChance = 65280;\r\nint firesize = 40;\r\nint SPARKING = 85;\r\nint COOLING =  120;\r\nbool gReverseDirection = false;\r\nuint8_t mark = 0;\r\nuint8_t gHue = 0; \r\nuint8_t startPosition = 0;\r\nuint8_t glitterChance = 250;\r\nint chaseDelay = 1000;\r\nint lastPosition = 1;\r\nint lightning = 1;\r\nint raceSpeed = 12;\r\nint BeatsPerMinute = 62;\r\nuint8_t numberOfRainbows = 7;\r\nint twinkleChance = 250;\r\nint eyeChance = 248;\r\nbool boot = true;\r\nString effect = \"None\";\r\nbool showGlitter = false;\r\nbool showLightning = false;\r\nbool audioEffects = false;\r\nbool showLights = false;\r\nbyte red1 = 255;\r\nbyte green1 = 0;\r\nbyte blue1 = 0;\r\nbyte red2 = 0;\r\nbyte green2 = 255;\r\nbyte blue2 = 0;\r\nbyte red3 = 0;\r\nbyte green3 = 0;\r\nbyte blue3 = 255;\r\nbyte redG = 255;\r\nbyte greenG = 255;\r\nbyte blueG = 255;\r\nbyte brightness = 255;\r\nchar charPayload[50];\r\nint maxLEDs = 500;\r\nint locatorLED = 0;\r\nchar MQTT_locatorLED[50];\r\nint locatorDelay = 1000;\r\n\r\n\r\n/*****************  SYSTEM FUNCTIONS  *************************************/\r\n/*****************  SYSTEM FUNCTIONS  *************************************/\r\n/*****************  SYSTEM FUNCTIONS  *************************************/\r\n/*****************  SYSTEM FUNCTIONS  *************************************/\r\n/*****************  SYSTEM FUNCTIONS  *************************************/\r\n\r\nvoid setup_wifi() \r\n{\r\n  // We start by connecting to a WiFi network\r\n  Serial.println();\r\n  Serial.print(\"Connecting to \");\r\n  Serial.println(ssid);\r\n\r\n  WiFi.hostname(USER_MQTT_CLIENT_NAME);\r\n  WiFi.begin(ssid, password);\r\n\r\n  while (WiFi.status() != WL_CONNECTED) {\r\n    delay(500);\r\n    Serial.print(\".\");\r\n  }\r\n\r\n  Serial.println(\"\");\r\n  Serial.println(\"WiFi connected\");\r\n  Serial.println(\"IP address: \");\r\n  Serial.println(WiFi.localIP());\r\n}\r\n\r\nvoid reconnect() \r\n{\r\n  // Loop until we're reconnected\r\n  int retries = 0;\r\n  while (!client.connected()) {\r\n    if(retries < 150)\r\n    {\r\n        Serial.print(\"Attempting MQTT connection...\");\r\n      // Attempt to connect\r\n      if (client.connect(mqtt_client_name, mqtt_user, mqtt_pass)) \r\n      {\r\n        Serial.println(\"connected\");\r\n        // Once connected, publish an announcement...\r\n        if(boot == true)\r\n        {\r\n          client.publish(USER_MQTT_CLIENT_NAME\"/checkIn\",\"Rebooted\");\r\n          boot = false;\r\n        }\r\n        if(boot == false)\r\n        {\r\n          client.publish(USER_MQTT_CLIENT_NAME\"/checkIn\",\"Reconnected\"); \r\n        }\r\n        // ... and resubscribe\r\n        client.subscribe(USER_MQTT_CLIENT_NAME\"/configure\");\r\n        client.subscribe(USER_MQTT_CLIENT_NAME\"/modifier\");\r\n        client.subscribe(USER_MQTT_CLIENT_NAME\"/effect\");\r\n        client.subscribe(USER_MQTT_CLIENT_NAME\"/state\");\r\n        client.subscribe(USER_MQTT_CLIENT_NAME\"/color1\");\r\n        client.subscribe(USER_MQTT_CLIENT_NAME\"/color2\");\r\n        client.subscribe(USER_MQTT_CLIENT_NAME\"/color3\");\r\n        client.subscribe(USER_MQTT_CLIENT_NAME\"/power\");\r\n        client.subscribe(USER_MQTT_CLIENT_NAME\"/brightness\");\r\n        client.subscribe(USER_MQTT_CLIENT_NAME\"/addEffects\");\r\n        client.subscribe(USER_MQTT_CLIENT_NAME\"/lightningChance\");\r\n        client.subscribe(USER_MQTT_CLIENT_NAME\"/glitterChance\");\r\n        client.subscribe(USER_MQTT_CLIENT_NAME\"/glitterColor\");\r\n      } \r\n      else \r\n      {\r\n        Serial.print(\"failed, rc=\");\r\n        Serial.print(client.state());\r\n        Serial.println(\" try again in 5 seconds\");\r\n        retries++;\r\n        // Wait 5 seconds before retrying\r\n        delay(5000);\r\n      }\r\n    }\r\n    if(retries > 1500)\r\n    {\r\n    ESP.restart();\r\n    }\r\n  }\r\n}\r\n\r\nvoid calculateMax()\r\n{\r\n  #if ZONEONE == 1\r\n  maxLEDs = FIRSTZONE_LEDS;\r\n  #endif\r\n  \r\n  #if ZONETWO == 1\r\n  maxLEDs = max(FIRSTZONE_LEDS, SECONDZONE_LEDS);\r\n  #endif\r\n\r\n  #if ZONETHREE == 1\r\n  maxLEDs = max(maxLEDs, THIRDZONE_LEDS);\r\n  #endif\r\n\r\n  #if ZONEFOUR == 1\r\n  maxLEDs = max(maxLEDs, FOURTHZONE_LEDS);\r\n  #endif\r\n\r\n  #if ZONEFIVE == 1\r\n  maxLEDs = max(maxLEDs, FIFTHZONE_LEDS);\r\n  #endif\r\n\r\n  #if ZONESIX == 1\r\n  maxLEDs = max(maxLEDs, SIXTHZONE_LEDS);\r\n  #endif \r\n}\r\n\r\n/************************** MQTT CALLBACK ***********************/\r\n/************************** MQTT CALLBACK ***********************/\r\n/************************** MQTT CALLBACK ***********************/\r\n/************************** MQTT CALLBACK ***********************/\r\n/************************** MQTT CALLBACK ***********************/\r\n\r\n\r\nvoid callback(char* topic, byte* payload, unsigned int length) \r\n{\r\n  Serial.print(\"Message arrived [\");\r\n  String newTopic = topic;\r\n  Serial.print(topic);\r\n  Serial.print(\"] \");\r\n  payload[length] = '\\0';\r\n  String newPayload = String((char *)payload);\r\n  int intPayload = newPayload.toInt();\r\n  Serial.println(newPayload);\r\n  Serial.println();\r\n  newPayload.toCharArray(charPayload, newPayload.length() + 1); \r\n  if (newTopic == USER_MQTT_CLIENT_NAME\"/modifier\")\r\n  {\r\n    client.publish(USER_MQTT_CLIENT_NAME\"/modifierState\", charPayload);\r\n    if(effect == \"Double_Crash\" || effect == \"Single_Race\")\r\n    {\r\n      raceSpeed = (intPayload/20);\r\n    }\r\n    if(effect == \"BPM\")\r\n    {\r\n      BeatsPerMinute = (intPayload/4);\r\n    }\r\n    if(effect == \"Color_Chase\" || effect == \"Blocked_Colors\")\r\n    {\r\n      chaseDelay = (intPayload*5);\r\n      if(chaseDelay < 100)\r\n      {\r\n        chaseDelay = 100;\r\n      }\r\n    }\r\n    if(effect == \"Color_Glitter\")\r\n    {\r\n      glitterChance = (intPayload/2);\r\n    }\r\n    if(effect == \"Rainbow\")\r\n    {\r\n      numberOfRainbows = (intPayload/30);\r\n    }\r\n    if(effect == \"Twinkle\")\r\n    {\r\n      twinkleChance = map(intPayload, 0, 500, 0, 255);\r\n    }\r\n    if(effect == \"Spooky_Eyes\")\r\n    {\r\n      eyeChance = map(intPayload, 0, 500, 200, 255);\r\n    }\r\n    if(effect == \"Fire\")\r\n    {\r\n      firesize = map(intPayload, 0, 500, 10, 120);\r\n    }\r\n    if(effect == \"LED_Locator\")\r\n    {\r\n      locatorDelay = map(intPayload, 0, 500, 500, 5000);\r\n    }\r\n  }\r\n  if (newTopic == USER_MQTT_CLIENT_NAME\"/addEffects\")\r\n  {\r\n    if(newPayload == \"Audio On\")\r\n    {\r\n      audioEffects = true;\r\n      client.publish(USER_MQTT_CLIENT_NAME\"/audio/state\", charPayload);\r\n    }\r\n    if(newPayload == \"Audio Off\")\r\n    {\r\n      audioEffects = false;\r\n      client.publish(USER_MQTT_CLIENT_NAME\"/audio/state\", charPayload);\r\n    }\r\n    if(newPayload == \"Glitter On\")\r\n    {\r\n      showGlitter = true;\r\n      client.publish(USER_MQTT_CLIENT_NAME\"/glitter/state\", charPayload);\r\n    }\r\n    if(newPayload == \"Glitter Off\")\r\n    {\r\n      showGlitter = false;\r\n      client.publish(USER_MQTT_CLIENT_NAME\"/glitter/state\", charPayload);\r\n    }\r\n    if(newPayload == \"Lightning On\")\r\n    {\r\n      showLightning = true;\r\n      client.publish(USER_MQTT_CLIENT_NAME\"/lightning/state\",\"Lightning On\");\r\n    }\r\n    if(newPayload == \"Lightning Off\")\r\n    {\r\n      showLightning = false;\r\n      client.publish(USER_MQTT_CLIENT_NAME\"/lightning/state\",\"Lightning Off\");\r\n    }\r\n  }\r\n  if (newTopic == USER_MQTT_CLIENT_NAME\"/effect\") \r\n  {\r\n    effect = newPayload;\r\n    client.publish(USER_MQTT_CLIENT_NAME\"/effectState\", charPayload);\r\n    \r\n    #if ZONEONE == 1\r\n    fill_solid(firstZone, FIRSTZONE_LEDS, CRGB::Black); \r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    fill_solid(secondZone, SECONDZONE_LEDS, CRGB::Black); \r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    fill_solid(thirdZone, THIRDZONE_LEDS, CRGB::Black);\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    fill_solid(fourthZone, FOURTHZONE_LEDS, CRGB::Black);\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    fill_solid(fifthZone, FIFTHZONE_LEDS, CRGB::Black); \r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    fill_solid(sixthZone, SIXTHZONE_LEDS, CRGB::Black);\r\n    #endif  \r\n\r\n    if(effect == \"LED_Locator\")\r\n    {\r\n      locator_Move();\r\n    }\r\n  }\r\n  \r\n  if (newTopic == USER_MQTT_CLIENT_NAME \"/color1\")\r\n  {\r\n    client.publish(USER_MQTT_CLIENT_NAME \"/color1State\", charPayload); \r\n    // get the position of the first and second commas\r\n    uint8_t firstIndex = newPayload.indexOf(',');\r\n    uint8_t lastIndex = newPayload.lastIndexOf(',');\r\n    \r\n    uint8_t rgb_red = newPayload.substring(0, firstIndex).toInt();\r\n    if (rgb_red < 0 || rgb_red > 255) {\r\n      return;\r\n    } else {\r\n      red1 = rgb_red;\r\n    }\r\n    \r\n    uint8_t rgb_green = newPayload.substring(firstIndex + 1, lastIndex).toInt();\r\n    if (rgb_green < 0 || rgb_green > 255) {\r\n      return;\r\n    } else {\r\n      green1 = rgb_green;\r\n    }\r\n    \r\n    uint8_t rgb_blue = newPayload.substring(lastIndex + 1).toInt();\r\n    if (rgb_blue < 0 || rgb_blue > 255) {\r\n      return;\r\n    } else {\r\n      blue1 = rgb_blue;\r\n    }\r\n  }\r\n\r\n  if (newTopic == USER_MQTT_CLIENT_NAME \"/color2\")\r\n  {\r\n    client.publish(USER_MQTT_CLIENT_NAME \"/color2State\", charPayload); \r\n    // get the position of the first and second commas\r\n    uint8_t firstIndex = newPayload.indexOf(',');\r\n    uint8_t lastIndex = newPayload.lastIndexOf(',');\r\n    \r\n    uint8_t rgb_red = newPayload.substring(0, firstIndex).toInt();\r\n    if (rgb_red < 0 || rgb_red > 255) {\r\n      return;\r\n    } else {\r\n      red2 = rgb_red;\r\n    }\r\n    \r\n    uint8_t rgb_green = newPayload.substring(firstIndex + 1, lastIndex).toInt();\r\n    if (rgb_green < 0 || rgb_green > 255) {\r\n      return;\r\n    } else {\r\n      green2 = rgb_green;\r\n    }\r\n    \r\n    uint8_t rgb_blue = newPayload.substring(lastIndex + 1).toInt();\r\n    if (rgb_blue < 0 || rgb_blue > 255) {\r\n      return;\r\n    } else {\r\n      blue2 = rgb_blue;\r\n    }\r\n  }\r\n\r\n  if (newTopic == USER_MQTT_CLIENT_NAME \"/color3\")\r\n  {\r\n    client.publish(USER_MQTT_CLIENT_NAME \"/color3State\", charPayload); \r\n    // get the position of the first and second commas\r\n    uint8_t firstIndex = newPayload.indexOf(',');\r\n    uint8_t lastIndex = newPayload.lastIndexOf(',');\r\n    \r\n    uint8_t rgb_red = newPayload.substring(0, firstIndex).toInt();\r\n    if (rgb_red < 0 || rgb_red > 255) {\r\n      return;\r\n    } else {\r\n      red3 = rgb_red;\r\n    }\r\n    \r\n    uint8_t rgb_green = newPayload.substring(firstIndex + 1, lastIndex).toInt();\r\n    if (rgb_green < 0 || rgb_green > 255) {\r\n      return;\r\n    } else {\r\n      green3 = rgb_green;\r\n    }\r\n    \r\n    uint8_t rgb_blue = newPayload.substring(lastIndex + 1).toInt();\r\n    if (rgb_blue < 0 || rgb_blue > 255) {\r\n      return;\r\n    } else {\r\n      blue3 = rgb_blue;\r\n    }\r\n  }\r\n\r\n  if (newTopic == USER_MQTT_CLIENT_NAME \"/glitterColor\")\r\n  {\r\n    client.publish(USER_MQTT_CLIENT_NAME \"/glitterColorState\", charPayload); \r\n    // get the position of the first and second commas\r\n    uint8_t firstIndex = newPayload.indexOf(',');\r\n    uint8_t lastIndex = newPayload.lastIndexOf(',');\r\n    \r\n    uint8_t rgb_red = newPayload.substring(0, firstIndex).toInt();\r\n    if (rgb_red < 0 || rgb_red > 255) {\r\n      return;\r\n    } else {\r\n      redG = rgb_red;\r\n    }\r\n    \r\n    uint8_t rgb_green = newPayload.substring(firstIndex + 1, lastIndex).toInt();\r\n    if (rgb_green < 0 || rgb_green > 255) {\r\n      return;\r\n    } else {\r\n      greenG = rgb_green;\r\n    }\r\n    \r\n    uint8_t rgb_blue = newPayload.substring(lastIndex + 1).toInt();\r\n    if (rgb_blue < 0 || rgb_blue > 255) {\r\n      return;\r\n    } else {\r\n      blueG = rgb_blue;\r\n    }\r\n  }\r\n  \r\n  if (newTopic == USER_MQTT_CLIENT_NAME\"/glitterChance\") \r\n  {\r\n    client.publish(USER_MQTT_CLIENT_NAME \"/glitterChanceState\", charPayload); \r\n    glitterFrequency = intPayload;\r\n  }\r\n  \r\n  if (newTopic == USER_MQTT_CLIENT_NAME\"/lightningChance\") \r\n  {\r\n    client.publish(USER_MQTT_CLIENT_NAME \"/lightningChanceState\", charPayload); \r\n    lightningChance = (65535 - intPayload);\r\n  }\r\n  \r\n  if (newTopic == USER_MQTT_CLIENT_NAME\"/brightness\") \r\n  {\r\n    client.publish(USER_MQTT_CLIENT_NAME \"/brightnessState\", charPayload); \r\n    brightness = intPayload;\r\n  }\r\n  \r\n  if (newTopic == USER_MQTT_CLIENT_NAME\"/power\")\r\n  {\r\n    client.publish(USER_MQTT_CLIENT_NAME \"/powerState\", charPayload); \r\n    if(newPayload == \"ON\")\r\n    {\r\n      showLights = true;\r\n    }\r\n    if(newPayload == \"OFF\")\r\n    {\r\n      showLights = false;\r\n    }\r\n  }\r\n}\r\n\r\n\r\n\r\n/*****************  GLOBAL LIGHT FUNCTIONS  *******************************/\r\n/*****************  GLOBAL LIGHT FUNCTIONS  *******************************/\r\n/*****************  GLOBAL LIGHT FUNCTIONS  *******************************/\r\n/*****************  GLOBAL LIGHT FUNCTIONS  *******************************/\r\n/*****************  GLOBAL LIGHT FUNCTIONS  *******************************/\r\n\r\n\r\nvoid chase()\r\n{\r\n  if(startPosition == 5)\r\n  {\r\n    startPosition = 0;\r\n  }\r\n  else\r\n  {\r\n    startPosition++;\r\n  }\r\n  timer.setTimeout(chaseDelay, chase);\r\n}\r\n\r\nvoid checkIn()\r\n{\r\n  client.publish(USER_MQTT_CLIENT_NAME\"/checkIn\",\"OK\");\r\n  timer.setTimeout(120000, checkIn);\r\n}\r\n\r\nvoid choosePattern()\r\n{\r\n  if(showLights == true)\r\n  {\r\n   if(effect == \"Color_Chase\")\r\n   {\r\n    #if ZONEONE == 1 \r\n    RGB_firstZone();\r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    RGB_secondZone(); \r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    RGB_thirdZone();\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    RGB_fourthZone();\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    RGB_fifthZone();\r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    RGB_sixthZone();\r\n    #endif \r\n      \r\n   }\r\n   if(effect == \"Color_Glitter\")\r\n   {\r\n\r\n    #if ZONEONE == 1 \r\n    ColorGlitter_firstZone(glitterChance);\r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    ColorGlitter_secondZone(glitterChance); \r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    ColorGlitter_thirdZone(glitterChance);\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    ColorGlitter_fourthZone(glitterChance);\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    ColorGlitter_fifthZone(glitterChance);\r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    ColorGlitter_sixthZone(glitterChance);\r\n    #endif  \r\n   }\r\n   if(effect == \"Single_Race\")\r\n   {\r\n\r\n    #if ZONEONE == 1 \r\n    SingleRace_firstZone();\r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    SingleRace_secondZone(); \r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    SingleRace_thirdZone();\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    SingleRace_fourthZone();\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    SingleRace_fifthZone();\r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    SingleRace_sixthZone();\r\n    #endif \r\n   }\r\n   if(effect == \"Double_Crash\")\r\n   {\r\n    #if ZONEONE == 1\r\n    Crash_firstZone();\r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    Crash_secondZone(); \r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    Crash_thirdZone();\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    Crash_fourthZone();\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    Crash_fifthZone();\r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    Crash_sixthZone();\r\n    #endif \r\n   }\r\n   if(effect == \"Rainbow\")\r\n   {\r\n    #if ZONEONE == 1  \r\n    Rainbow_firstZone();\r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    Rainbow_secondZone(); \r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    Rainbow_thirdZone();\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    Rainbow_fourthZone();\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    Rainbow_fifthZone();\r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    Rainbow_sixthZone();\r\n    #endif \r\n   }\r\n   if(effect == \"Blocked_Colors\")\r\n   {\r\n    #if ZONEONE == 1\r\n    Blocked_firstZone();\r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    Blocked_secondZone(); \r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    Blocked_thirdZone();\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    Blocked_fourthZone();\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    Blocked_fifthZone();\r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    Blocked_sixthZone();\r\n    #endif \r\n\r\n   }\r\n   if(effect == \"BPM\")\r\n   {\r\n\r\n    #if ZONEONE == 1\r\n    BPM_firstZone();\r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    BPM_secondZone(); \r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    BPM_thirdZone();\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    BPM_fourthZone();\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    BPM_fifthZone();\r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    BPM_sixthZone();\r\n    #endif \r\n   }\r\n   if(effect == \"Twinkle\")\r\n   {\r\n    #if ZONEONE == 1\r\n    Twinkle_firstZone();\r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    Twinkle_secondZone(); \r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    Twinkle_thirdZone();\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    Twinkle_fourthZone();\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    Twinkle_fifthZone();\r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    Twinkle_sixthZone();\r\n    #endif \r\n\r\n   }\r\n   if(effect == \"Fill_Solid\")\r\n   {\r\n    #if ZONEONE == 1\r\n    Solid_firstZone();\r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    Solid_secondZone(); \r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    Solid_thirdZone();\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    Solid_fourthZone();\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    Solid_fifthZone();\r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    Solid_sixthZone();\r\n    #endif\r\n    \r\n   }\r\n   if(effect == \"Spooky_Eyes\")\r\n   {\r\n    #if ZONEONE == 1\r\n    Eyes_firstZone();\r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    Eyes_secondZone(); \r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    Eyes_thirdZone();\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    Eyes_fourthZone();\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    Eyes_fifthZone();\r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    Eyes_sixthZone();\r\n    #endif\r\n\r\n   }\r\n   \r\n   if(effect == \"LED_Locator\")\r\n   {\r\n    #if ZONEONE == 1\r\n    Locator_firstZone();\r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    Locator_secondZone(); \r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    Locator_thirdZone();\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    Locator_fourthZone();\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    Locator_fifthZone();\r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    Locator_sixthZone();\r\n    #endif\r\n\r\n   }\r\n   if(effect == \"Ripple\")\r\n   {\r\n\r\n    #if ZONEONE == 1 \r\n    Ripple_firstZone();\r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    Ripple_secondZone(); \r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    Ripple_thirdZone();\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    Ripple_fourthZone();\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    Ripple_fifthZone();\r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    Ripple_sixthZone();\r\n    #endif\r\n   }\r\n   if(effect == \"Fire\")\r\n   {\r\n\r\n    #if ZONEONE == 1 \r\n      #if FIRSTZONE_SECTIONS >= 1\r\n      fire_firstZone_SECTION1();\r\n      #endif\r\n      #if FIRSTZONE_SECTIONS >= 2\r\n      fire_firstZone_SECTION2();\r\n      #endif\r\n      #if FIRSTZONE_SECTIONS >= 3\r\n      fire_firstZone_SECTION3();\r\n      #endif\r\n      #if FIRSTZONE_SECTIONS >= 4\r\n      fire_firstZone_SECTION4();\r\n      #endif\r\n      #if FIRSTZONE_SECTIONS >= 5\r\n      fire_firstZone_SECTION5();\r\n      #endif\r\n      #if FIRSTZONE_SECTIONS >= 6\r\n      fire_firstZone_SECTION6();\r\n      #endif\r\n      #if FIRSTZONE_SECTIONS >= 7\r\n      fire_firstZone_SECTION7();\r\n      #endif\r\n      #if FIRSTZONE_SECTIONS >= 8\r\n      fire_firstZone_SECTION8();\r\n      #endif\r\n      #if FIRSTZONE_SECTIONS >= 9\r\n      fire_firstZone_SECTION9();\r\n      #endif\r\n    #endif\r\n\r\n    #if ZONETWO == 1 \r\n      #if SECONDZONE_SECTIONS >= 1\r\n      fire_secondZone_SECTION1();\r\n      #endif\r\n      #if SECONDZONE_SECTIONS >= 2\r\n      fire_secondZone_SECTION2();\r\n      #endif\r\n      #if SECONDZONE_SECTIONS >= 3\r\n      fire_secondZone_SECTION3();\r\n      #endif\r\n      #if SECONDZONE_SECTIONS >= 4\r\n      fire_secondZone_SECTION4();\r\n      #endif\r\n      #if SECONDZONE_SECTIONS >= 5\r\n      fire_secondZone_SECTION5();\r\n      #endif\r\n      #if SECONDZONE_SECTIONS >= 6\r\n      fire_secondZone_SECTION6();\r\n      #endif\r\n      #if SECONDZONE_SECTIONS >= 7\r\n      fire_secondZone_SECTION7();\r\n      #endif\r\n      #if SECONDZONE_SECTIONS >= 8\r\n      fire_secondZone_SECTION8();\r\n      #endif\r\n      #if SECONDZONE_SECTIONS >= 9\r\n      fire_secondZone_SECTION9();\r\n      #endif\r\n    #endif\r\n\r\n    #if ZONETHREE == 1 \r\n      #if THIRDZONE_SECTIONS >= 1\r\n      fire_thirdZone_SECTION1();\r\n      #endif\r\n      #if THIRDZONE_SECTIONS >= 2\r\n      fire_thirdZone_SECTION2();\r\n      #endif\r\n      #if THIRDZONE_SECTIONS >= 3\r\n      fire_thirdZone_SECTION3();\r\n      #endif\r\n      #if THIRDZONE_SECTIONS >= 4\r\n      fire_thirdZone_SECTION4();\r\n      #endif\r\n      #if THIRDZONE_SECTIONS >= 5\r\n      fire_thirdZone_SECTION5();\r\n      #endif\r\n      #if THIRDZONE_SECTIONS >= 6\r\n      fire_thirdZone_SECTION6();\r\n      #endif\r\n      #if THIRDZONE_SECTIONS >= 7\r\n      fire_thirdZone_SECTION7();\r\n      #endif\r\n      #if THIRDZONE_SECTIONS >= 8\r\n      fire_thirdZone_SECTION8();\r\n      #endif\r\n      #if THIRDZONE_SECTIONS >= 9\r\n      fire_thirdZone_SECTION9();\r\n      #endif\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1 \r\n      #if FOURTHZONE_SECTIONS >= 1\r\n      fire_fourthZone_SECTION1();\r\n      #endif\r\n      #if FOURTHZONE_SECTIONS >= 2\r\n      fire_fourthZone_SECTION2();\r\n      #endif\r\n      #if FOURTHZONE_SECTIONS >= 3\r\n      fire_fourthZone_SECTION3();\r\n      #endif\r\n      #if FOURTHZONE_SECTIONS >= 4\r\n      fire_fourthZone_SECTION4();\r\n      #endif\r\n      #if FOURTHZONE_SECTIONS >= 5\r\n      fire_fourthZone_SECTION5();\r\n      #endif\r\n      #if FOURTHZONE_SECTIONS >= 6\r\n      fire_fourthZone_SECTION6();\r\n      #endif\r\n      #if FOURTHZONE_SECTIONS >= 7\r\n      fire_fourthZone_SECTION7();\r\n      #endif\r\n      #if FOURTHZONE_SECTIONS >= 8\r\n      fire_fourthZone_SECTION8();\r\n      #endif\r\n      #if FOURTHZONE_SECTIONS >= 9\r\n      fire_fourthZone_SECTION9();\r\n      #endif\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1 \r\n      #if FIFTHZONE_SECTIONS >= 1\r\n      fire_fifthZone_SECTION1();\r\n      #endif\r\n      #if FIFTHZONE_SECTIONS >= 2\r\n      fire_fifthZone_SECTION2();\r\n      #endif\r\n      #if FIFTHZONE_SECTIONS >= 3\r\n      fire_fifthZone_SECTION3();\r\n      #endif\r\n      #if FIFTHZONE_SECTIONS >= 4\r\n      fire_fifthZone_SECTION4();\r\n      #endif\r\n      #if FIFTHZONE_SECTIONS >= 5\r\n      fire_fifthZone_SECTION5();\r\n      #endif\r\n      #if FIFTHZONE_SECTIONS >= 6\r\n      fire_fifthZone_SECTION6();\r\n      #endif\r\n      #if FIFTHZONE_SECTIONS >= 7\r\n      fire_fifthZone_SECTION7();\r\n      #endif\r\n      #if FIFTHZONE_SECTIONS >= 8\r\n      fire_fifthZone_SECTION8();\r\n      #endif\r\n      #if FIFTHZONE_SECTIONS >= 9\r\n      fire_fifthZone_SECTION9();\r\n      #endif\r\n    #endif\r\n\r\n    #if ZONESIX == 1 \r\n      #if SIXTHZONE_SECTIONS >= 1\r\n      fire_sixthZone_SECTION1();\r\n      #endif\r\n      #if SIXTHZONE_SECTIONS >= 2\r\n      fire_sixthZone_SECTION2();\r\n      #endif\r\n      #if SIXTHZONE_SECTIONS >= 3\r\n      fire_sixthZone_SECTION3();\r\n      #endif\r\n      #if SIXTHZONE_SECTIONS >= 4\r\n      fire_sixthZone_SECTION4();\r\n      #endif\r\n      #if SIXTHZONE_SECTIONS >= 5\r\n      fire_sixthZone_SECTION5();\r\n      #endif\r\n      #if SIXTHZONE_SECTIONS >= 6\r\n      fire_sixthZone_SECTION6();\r\n      #endif\r\n      #if SIXTHZONE_SECTIONS >= 7\r\n      fire_sixthZone_SECTION7();\r\n      #endif\r\n      #if SIXTHZONE_SECTIONS >= 8\r\n      fire_sixthZone_SECTION8();\r\n      #endif\r\n      #if SIXTHZONE_SECTIONS >= 9\r\n      fire_sixthZone_SECTION9();\r\n      #endif\r\n    #endif\r\n   }\r\n  }\r\n  if(showLights == false)\r\n  {\r\n    #if ZONEONE == 1 \r\n    fill_solid(firstZone, FIRSTZONE_LEDS, CRGB::Black); \r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    fill_solid(secondZone, SECONDZONE_LEDS, CRGB::Black); \r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    fill_solid(thirdZone, THIRDZONE_LEDS, CRGB::Black);\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    fill_solid(fourthZone, FOURTHZONE_LEDS, CRGB::Black);\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    fill_solid(fifthZone, FIFTHZONE_LEDS, CRGB::Black); \r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    fill_solid(sixthZone, SIXTHZONE_LEDS, CRGB::Black);\r\n    #endif\r\n  }\r\n  addGlitter();\r\n  addLightning(); \r\n}\r\n\r\n/*********************** PATTERN MODIFIERS ***************************/\r\n/*********************** PATTERN MODIFIERS ***************************/\r\n/*********************** PATTERN MODIFIERS ***************************/\r\n/*********************** PATTERN MODIFIERS ***************************/\r\n/*********************** PATTERN MODIFIERS ***************************/\r\n\r\nvoid addLightning()\r\n{\r\n  if(showLightning == true)\r\n  {\r\n    #if ZONEONE == 1 \r\n    fadeToBlackBy(firstZone, FIRSTZONE_LEDS, 1); \r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    fadeToBlackBy(secondZone, SECONDZONE_LEDS, 1); \r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    fadeToBlackBy(thirdZone, THIRDZONE_LEDS, 1);\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    fadeToBlackBy(fourthZone, FOURTHZONE_LEDS, 1);\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    fadeToBlackBy(fifthZone, FIFTHZONE_LEDS, 1); \r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    fadeToBlackBy(sixthZone, SIXTHZONE_LEDS, 1);\r\n    #endif\r\n    \r\n    unsigned int chance = random16();\r\n    if( chance > lightningChance) \r\n    {\r\n      #if ZONEONE == 1 \r\n      fill_solid(firstZone, FIRSTZONE_LEDS, CRGB::White); \r\n      #endif\r\n  \r\n      #if ZONETWO == 1\r\n      fill_solid(secondZone, SECONDZONE_LEDS, CRGB::White); \r\n      #endif\r\n  \r\n      #if ZONETHREE == 1\r\n      fill_solid(thirdZone, THIRDZONE_LEDS, CRGB::White);\r\n      #endif\r\n  \r\n      #if ZONEFOUR == 1\r\n      fill_solid(fourthZone, FOURTHZONE_LEDS, CRGB::White);\r\n      #endif\r\n  \r\n      #if ZONEFIVE == 1\r\n      fill_solid(fifthZone, FIFTHZONE_LEDS, CRGB::White); \r\n      #endif\r\n      \r\n      #if ZONESIX == 1\r\n      fill_solid(sixthZone, SIXTHZONE_LEDS, CRGB::White);\r\n      #endif\r\n\r\n      lightning = 20;\r\n      if(audioEffects == true)\r\n      {\r\n        int thunder = random8();\r\n        if( thunder > 128)\r\n        {\r\n          client.publish(\"Audio\",\"2\");\r\n        }\r\n        if( thunder < 127)\r\n        {\r\n          client.publish(\"Audio\",\"1\");\r\n        }\r\n      }\r\n    }\r\n    if(lightning != 1)\r\n    {\r\n      if(lightning > 15)\r\n      {\r\n        #if ZONEONE == 1  \r\n        fadeToBlackBy(firstZone, FIRSTZONE_LEDS, 150); \r\n        #endif\r\n    \r\n        #if ZONETWO == 1\r\n        fadeToBlackBy(secondZone, SECONDZONE_LEDS, 150); \r\n        #endif\r\n    \r\n        #if ZONETHREE == 1\r\n        fadeToBlackBy(thirdZone, THIRDZONE_LEDS, 150);\r\n        #endif\r\n    \r\n        #if ZONEFOUR == 1\r\n        fadeToBlackBy(fourthZone, FOURTHZONE_LEDS, 150);\r\n        #endif\r\n    \r\n        #if ZONEFIVE == 1\r\n        fadeToBlackBy(fifthZone, FIFTHZONE_LEDS, 150); \r\n        #endif\r\n        \r\n        #if ZONESIX == 1\r\n        fadeToBlackBy(sixthZone, SIXTHZONE_LEDS, 150);\r\n        #endif\r\n\r\n        lightning--;\r\n      }\r\n      if(lightning == 15)\r\n      {\r\n\r\n        #if ZONEONE == 1 \r\n        fill_solid(firstZone, FIRSTZONE_LEDS, CRGB::White); \r\n        #endif\r\n    \r\n        #if ZONETWO == 1\r\n        fill_solid(secondZone, SECONDZONE_LEDS, CRGB::White); \r\n        #endif\r\n    \r\n        #if ZONETHREE == 1\r\n        fill_solid(thirdZone, THIRDZONE_LEDS, CRGB::White);\r\n        #endif\r\n    \r\n        #if ZONEFOUR == 1\r\n        fill_solid(fourthZone, FOURTHZONE_LEDS, CRGB::White);\r\n        #endif\r\n    \r\n        #if ZONEFIVE == 1\r\n        fill_solid(fifthZone, FIFTHZONE_LEDS, CRGB::White); \r\n        #endif\r\n        \r\n        #if ZONESIX == 1\r\n        fill_solid(sixthZone, SIXTHZONE_LEDS, CRGB::White);\r\n        #endif\r\n        lightning--; \r\n      }\r\n      if(lightning > 5 && lightning < 15)\r\n      {\r\n        #if ZONEONE == 1\r\n        fadeToBlackBy(firstZone, FIRSTZONE_LEDS, 150); \r\n        #endif\r\n    \r\n        #if ZONETWO == 1\r\n        fadeToBlackBy(secondZone, SECONDZONE_LEDS, 150); \r\n        #endif\r\n    \r\n        #if ZONETHREE == 1\r\n        fadeToBlackBy(thirdZone, THIRDZONE_LEDS, 150);\r\n        #endif\r\n    \r\n        #if ZONEFOUR == 1\r\n        fadeToBlackBy(fourthZone, FOURTHZONE_LEDS, 150);\r\n        #endif\r\n    \r\n        #if ZONEFIVE == 1\r\n        fadeToBlackBy(fifthZone, FIFTHZONE_LEDS, 150); \r\n        #endif\r\n        \r\n        #if ZONESIX == 1\r\n        fadeToBlackBy(sixthZone, SIXTHZONE_LEDS, 150);\r\n        #endif\r\n        lightning--;\r\n      }\r\n      if(lightning == 5)\r\n      {\r\n        #if ZONEONE == 1 \r\n        fill_solid(firstZone, FIRSTZONE_LEDS, CRGB::White); \r\n        #endif\r\n    \r\n        #if ZONETWO == 1\r\n        fill_solid(secondZone, SECONDZONE_LEDS, CRGB::White); \r\n        #endif\r\n    \r\n        #if ZONETHREE == 1\r\n        fill_solid(thirdZone, THIRDZONE_LEDS, CRGB::White);\r\n        #endif\r\n    \r\n        #if ZONEFOUR == 1\r\n        fill_solid(fourthZone, FOURTHZONE_LEDS, CRGB::White);\r\n        #endif\r\n    \r\n        #if ZONEFIVE == 1\r\n        fill_solid(fifthZone, FIFTHZONE_LEDS, CRGB::White); \r\n        #endif\r\n        \r\n        #if ZONESIX == 1\r\n        fill_solid(sixthZone, SIXTHZONE_LEDS, CRGB::White);\r\n        #endif\r\n        lightning--; \r\n      }\r\n      if(lightning > 0 && lightning < 5)\r\n      {\r\n        #if ZONEONE == 1\r\n        fadeToBlackBy(firstZone, FIRSTZONE_LEDS, 150); \r\n        #endif\r\n    \r\n        #if ZONETWO == 1\r\n        fadeToBlackBy(secondZone, SECONDZONE_LEDS, 150); \r\n        #endif\r\n    \r\n        #if ZONETHREE == 1\r\n        fadeToBlackBy(thirdZone, THIRDZONE_LEDS, 150);\r\n        #endif\r\n    \r\n        #if ZONEFOUR == 1\r\n        fadeToBlackBy(fourthZone, FOURTHZONE_LEDS, 150);\r\n        #endif\r\n    \r\n        #if ZONEFIVE == 1\r\n        fadeToBlackBy(fifthZone, FIFTHZONE_LEDS, 150); \r\n        #endif\r\n        \r\n        #if ZONESIX == 1\r\n        fadeToBlackBy(sixthZone, SIXTHZONE_LEDS, 150);\r\n        #endif\r\n        lightning--;\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\nvoid addGlitter() \r\n{\r\n  if(showGlitter == true)\r\n  {     \r\n    if( random8() < glitterFrequency) \r\n    {\r\n      #if ZONEONE == 1 \r\n      {\r\n        firstZone[ random16(FIRSTZONE_LEDS) ] = CRGB(redG, greenG, blueG);  \r\n      }\r\n      #endif\r\n  \r\n      #if ZONETWO == 1\r\n      {\r\n        secondZone[ random16(SECONDZONE_LEDS) ] = CRGB(redG, greenG, blueG);  \r\n      }\r\n      #endif\r\n  \r\n      #if ZONETHREE == 1\r\n      {\r\n        thirdZone[ random16(THIRDZONE_LEDS) ] = CRGB(redG, greenG, blueG);  \r\n      }\r\n      #endif\r\n  \r\n      #if ZONEFOUR == 1\r\n      {\r\n        fourthZone[ random16(FOURTHZONE_LEDS) ] = CRGB(redG, greenG, blueG);  \r\n      }\r\n      #endif\r\n  \r\n      #if ZONEFIVE == 1\r\n      {\r\n        fifthZone[ random16(FIFTHZONE_LEDS) ] = CRGB(redG, greenG, blueG);  \r\n      }\r\n      #endif\r\n      \r\n      #if ZONESIX == 1\r\n      {\r\n        sixthZone[ random16(SIXTHZONE_LEDS) ] = CRGB(redG, greenG, blueG);  \r\n      }\r\n      #endif  \r\n    }\r\n  }\r\n}\r\n\r\nvoid setupZones()\r\n{\r\n    #if ZONEONE == 1\r\n    FastLED.addLeds<WS2812B, Pin_firstZone, FIRSTZONE_COLOR_ORDER>(firstZone, FIRSTZONE_LEDS);\r\n    #endif\r\n\r\n    #if ZONETWO == 1\r\n    FastLED.addLeds<WS2812B, Pin_secondZone, SECONDZONE_COLOR_ORDER>(secondZone, SECONDZONE_LEDS);\r\n    #endif\r\n\r\n    #if ZONETHREE == 1\r\n    FastLED.addLeds<WS2812B, Pin_thirdZone, THIRDZONE_COLOR_ORDER>(thirdZone, THIRDZONE_LEDS);\r\n    #endif\r\n\r\n    #if ZONEFOUR == 1\r\n    FastLED.addLeds<WS2812B, Pin_fourthZone, FOURTHZONE_COLOR_ORDER>(fourthZone, FOURTHZONE_LEDS);\r\n    #endif\r\n\r\n    #if ZONEFIVE == 1\r\n    FastLED.addLeds<WS2812B, Pin_fifthZone, FIFTHZONE_COLOR_ORDER>(fifthZone, FIFTHZONE_LEDS);\r\n    #endif\r\n    \r\n    #if ZONESIX == 1\r\n    FastLED.addLeds<WS2812B, Pin_sixthZone, SIXTHZONE_COLOR_ORDER>(sixthZone, SIXTHZONE_LEDS);\r\n    #endif\r\n}\r\n\r\n\r\nvoid locator_Move()\r\n{\r\n  if(effect == \"LED_Locator\")\r\n  {\r\n    if(locatorLED <= maxLEDs)\r\n    {\r\n      String temp_str = String(locatorLED);\r\n      temp_str.toCharArray(MQTT_locatorLED, temp_str.length() + 1);\r\n      client.publish(USER_MQTT_CLIENT_NAME\"/locator\", MQTT_locatorLED);\r\n      locatorLED++;    \r\n    }\r\n    else\r\n    {\r\n      locatorLED = 0;\r\n    }\r\n    timer.setTimeout(locatorDelay, locator_Move);\r\n  }\r\n}\r\n\r\n\r\n\r\n/*****************  SETUP FUNCTION  ****************************************/\r\n/*****************  SETUP FUNCTION  ****************************************/\r\n/*****************  SETUP FUNCTION  ****************************************/\r\n/*****************  SETUP FUNCTION  ****************************************/\r\n/*****************  SETUP FUNCTION  ****************************************/\r\n\r\n\r\nvoid setup() {\r\n  Serial.begin(115200);\r\n  calculateMax();\r\n  setupZones();\r\n  FastLED.setDither( 0 );\r\n  WiFi.setSleepMode(WIFI_NONE_SLEEP);\r\n  WiFi.mode(WIFI_STA);\r\n  setup_wifi();\r\n  client.setServer(mqtt_server, mqtt_port);\r\n  client.setCallback(callback);\r\n  ArduinoOTA.setHostname(USER_MQTT_CLIENT_NAME);\r\n  ArduinoOTA.begin(); \r\n\r\n  gPal = HeatColors_p;\r\n  \r\n  timer.setTimeout(10000, chase);\r\n  timer.setTimeout(120000, checkIn);\r\n\r\n}\r\n\r\n\r\n/*****************  MAIN LOOP  ****************************************/\r\n/*****************  MAIN LOOP  ****************************************/\r\n/*****************  MAIN LOOP  ****************************************/\r\n/*****************  MAIN LOOP  ****************************************/\r\n/*****************  MAIN LOOP  ****************************************/\r\n\r\n\r\nvoid loop() \r\n{\r\n  if (!client.connected()) \r\n  {\r\n    reconnect();\r\n  }\r\n  client.loop();\r\n  if(showLights == false)\r\n  {\r\n    ArduinoOTA.handle();  \r\n  }\r\n  timer.run();\r\n  EVERY_N_MILLISECONDS( 20 ) { gHue++; }\r\n  choosePattern();\r\n\r\n  #if ZONEONE == 1\r\n  FastLED[0].showLeds(brightness);\r\n  #endif\r\n\r\n  #if ZONETWO == 1\r\n  FastLED[1].showLeds(brightness);\r\n  #endif\r\n\r\n  #if ZONETHREE == 1\r\n  FastLED[2].showLeds(brightness);\r\n  #endif\r\n\r\n  #if ZONEFOUR == 1\r\n  FastLED[3].showLeds(brightness);\r\n  #endif\r\n\r\n  #if ZONEFIVE == 1\r\n  FastLED[4].showLeds(brightness);\r\n  #endif\r\n  \r\n  #if ZONESIX == 1\r\n  FastLED[5].showLeds(brightness);\r\n  #endif\r\n  \r\n}\r\n\r\n\r\n\r\n/*****************  firstZone Animations  ****************************************/\r\n/*****************  firstZone Animations  ****************************************/\r\n/*****************  firstZone Animations  ****************************************/\r\n/*****************  firstZone Animations  ****************************************/\r\n/*****************  firstZone Animations  ****************************************/\r\n\r\n#if ZONEONE == 1\r\n\r\n\r\nvoid Ripple_firstZone()\r\n{\r\n  for (int i = 0; i < FIRSTZONE_LEDS; i++)\r\n  {\r\n    firstZone[i] = CRGB((red2/75), (green2/75), (blue2/75));\r\n  }   \r\n  switch (step_firstZone) \r\n  {\r\n    case -1:                                                          \r\n      center_firstZone = random16(FIRSTZONE_LEDS);\r\n      step_firstZone = 0;\r\n      break;\r\n    case 0:\r\n      firstZone[center_firstZone] = CRGB(red1, green1, blue1);                          \r\n      step_firstZone ++;\r\n      break;\r\n    case 12:                                                   \r\n      step_firstZone = -1;\r\n      break;\r\n    default:                                                             // Middle of the ripples.\r\n      firstZone[(center_firstZone + step_firstZone + FIRSTZONE_LEDS) % FIRSTZONE_LEDS] += CRGB((red1/(step_firstZone * 5)), (green1/(step_firstZone * 5)), (blue1/(step_firstZone * 5)));\r\n      firstZone[(center_firstZone - step_firstZone + FIRSTZONE_LEDS) % FIRSTZONE_LEDS] += CRGB((red1/(step_firstZone * 5)), (green1/(step_firstZone * 5)), (blue1/(step_firstZone * 5)));\r\n      step_firstZone ++;                                                         \r\n      break;\r\n  }\r\n}\r\n\r\nvoid RGB_firstZone()\r\n{\r\n  if(startPosition < 6)\r\n  {\r\n    fadeToBlackBy( firstZone, FIRSTZONE_LEDS, 80);\r\n    for(int pixel = startPosition+1; pixel < FIRSTZONE_LEDS; pixel+=6)  \r\n    {\r\n      if(pixel <= FIRSTZONE_LEDS)\r\n      {\r\n        firstZone[pixel] = CRGB(red1,green1,blue1);\r\n      }\r\n    }\r\n    for(int pixel = startPosition+3; pixel < FIRSTZONE_LEDS; pixel+=6)\r\n    {\r\n      if(pixel <= FIRSTZONE_LEDS)\r\n      {\r\n        firstZone[pixel] = CRGB(red2,green2,blue2);\r\n      }\r\n    }\r\n    for(int pixel = startPosition+5; pixel < FIRSTZONE_LEDS; pixel+=6)\r\n    {\r\n      if(pixel <= FIRSTZONE_LEDS)\r\n      {\r\n        firstZone[pixel] = CRGB(red3,green3,blue3);\r\n      } \r\n    }\r\n  }\r\n  if(startPosition == 1)\r\n  {\r\n    firstZone[0]=CRGB(red3,green3,blue3);\r\n  }\r\n  if(startPosition == 2)\r\n  {\r\n    firstZone[1]=CRGB(red3,green3,blue3);\r\n  }\r\n  if(startPosition == 3)\r\n  {\r\n    firstZone[2]=CRGB(red3,green3,blue3);\r\n    firstZone[0]=CRGB(red2,green2,blue2);\r\n  }\r\n  if(startPosition == 4)\r\n  {\r\n    firstZone[3]=CRGB(red3,green3,blue3);\r\n    firstZone[1]=CRGB(red2,green2,blue2);\r\n  }\r\n  if(startPosition == 5)\r\n  {\r\n    firstZone[4]=CRGB(red3,green3,blue3);\r\n    firstZone[2]=CRGB(red2,green2,blue2);\r\n    firstZone[0]=CRGB(red1,green1,blue1);\r\n  }\r\n}\r\n\r\nvoid ColorGlitter_firstZone( fract8 chanceOfGlitter) \r\n{\r\n  fadeToBlackBy( firstZone, FIRSTZONE_LEDS, 2);\r\n  if(startPosition == 0)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    firstZone[ random16(FIRSTZONE_LEDS) ] += CRGB::Red;\r\n    }\r\n  }\r\n  if(startPosition == 1)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    firstZone[ random16(FIRSTZONE_LEDS) ] += CRGB::Orange;\r\n    }\r\n  }\r\n  if(startPosition == 2)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    firstZone[ random16(FIRSTZONE_LEDS) ] += CRGB::Yellow;\r\n    }  \r\n  }\r\n  if(startPosition == 3)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    firstZone[ random16(FIRSTZONE_LEDS) ] += CRGB::Green;\r\n    }\r\n  }\r\n  if(startPosition == 4)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    firstZone[ random16(FIRSTZONE_LEDS) ] += CRGB::Blue;\r\n    }\r\n  }\r\n  if(startPosition == 5)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    firstZone[ random16(FIRSTZONE_LEDS) ] += CRGB::Violet;\r\n    }\r\n  } \r\n}\r\n\r\nvoid SingleRace_firstZone()\r\n{\r\n  fadeToBlackBy( firstZone, FIRSTZONE_LEDS, 1);\r\n  int pos = beatsin16( raceSpeed, 0, FIRSTZONE_LEDS);\r\n  if(pos > previousLED_firstZone)\r\n  {\r\n    firstZone[pos] = CRGB(red1,green1,blue1);\r\n    previousLED_firstZone = pos;\r\n  }\r\n  if(pos < previousLED_firstZone)\r\n  {\r\n    firstZone[pos] = CRGB(red2,green2,blue2);\r\n    previousLED_firstZone = pos;\r\n  }                 \r\n}\r\n\r\nvoid Crash_firstZone()\r\n{\r\n  fadeToBlackBy( firstZone, FIRSTZONE_LEDS, 15);\r\n  #ifdef ZONEONE_SECTION1_START\r\n  int pos_SECTION1 = beatsin16( raceSpeed, 0, (ZONEONE_SECTION1_END - ZONEONE_SECTION1_START) );\r\n  firstZone[ZONEONE_SECTION1_START + pos_SECTION1] = CRGB(red1,green1,blue1);\r\n  firstZone[ZONEONE_SECTION1_END - pos_SECTION1] = CRGB(red2,green2,blue2);\r\n  #endif\r\n\r\n  #ifdef ZONEONE_SECTION2_START\r\n  int pos_SECTION2 = beatsin16( raceSpeed, 0, (ZONEONE_SECTION2_END - ZONEONE_SECTION2_START) );\r\n  firstZone[ZONEONE_SECTION2_START + pos_SECTION2] = CRGB(red2,green2,blue2);\r\n  firstZone[ZONEONE_SECTION2_END - pos_SECTION2] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONEONE_SECTION3_START\r\n  int pos_SECTION3 = beatsin16( raceSpeed, 0, (ZONEONE_SECTION3_END - ZONEONE_SECTION3_START) );\r\n  firstZone[ZONEONE_SECTION3_START + pos_SECTION3] = CRGB(red1,green1,blue1);\r\n  firstZone[ZONEONE_SECTION3_END - pos_SECTION3] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONEONE_SECTION4_START\r\n  int pos_SECTION4 = beatsin16( raceSpeed, 0, (ZONEONE_SECTION4_END - ZONEONE_SECTION4_START) );\r\n  firstZone[ZONEONE_SECTION4_START + pos_SECTION4] = CRGB(red2,green2,blue2);\r\n  firstZone[ZONEONE_SECTION4_END - pos_SECTION4] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONEONE_SECTION5_START\r\n  int pos_SECTION5 = beatsin16( raceSpeed, 0, (ZONEONE_SECTION5_END - ZONEONE_SECTION5_START) );\r\n  firstZone[ZONEONE_SECTION5_START + pos_SECTION5] = CRGB(red1,green1,blue1);\r\n  firstZone[ZONEONE_SECTION5_END - pos_SECTION5] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONEONE_SECTION6_START\r\n  int pos_SECTION6 = beatsin16( raceSpeed, 0, (ZONEONE_SECTION6_END - ZONEONE_SECTION6_START) );\r\n  firstZone[ZONEONE_SECTION6_START + pos_SECTION6] = CRGB(red2,green2,blue2);\r\n  firstZone[ZONEONE_SECTION6_END - pos_SECTION6] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONEONE_SECTION7_START\r\n  int pos_SECTION7 = beatsin16( raceSpeed, 0, (ZONEONE_SECTION7_END - ZONEONE_SECTION7_START) );\r\n  firstZone[ZONEONE_SECTION7_START + pos_SECTION7] = CRGB(red1,green1,blue1);\r\n  firstZone[ZONEONE_SECTION7_END - pos_SECTION7] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONEONE_SECTION8_START\r\n  int pos_SECTION8 = beatsin16( raceSpeed, 0, (ZONEONE_SECTION8_END - ZONEONE_SECTION8_START) );\r\n  firstZone[ZONEONE_SECTION8_START + pos_SECTION8] = CRGB(red2,green2,blue2);\r\n  firstZone[ZONEONE_SECTION8_END - pos_SECTION8] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONEONE_SECTION9_START\r\n  int pos_SECTION9 = beatsin16( raceSpeed, 0, (ZONEONE_SECTION9_END - ZONEONE_SECTION9_START) );\r\n  firstZone[ZONEONE_SECTION9_START + pos_SECTION9] = CRGB(red1,green1,blue1);\r\n  firstZone[ZONEONE_SECTION9_END - pos_SECTION9] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n}\r\n\r\nvoid Rainbow_firstZone()\r\n{\r\n  fill_rainbow( firstZone, FIRSTZONE_LEDS, gHue, numberOfRainbows);\r\n}\r\n\r\nvoid Blocked_firstZone()\r\n{\r\n  fadeToBlackBy( firstZone, FIRSTZONE_LEDS, 2);\r\n  for( int mark = 0; mark < FIRSTZONE_LEDS; mark+=30)\r\n  {\r\n    for( int i = 0; i < 9; i++) \r\n    {\r\n      if(startPosition == 0 || startPosition == 1)\r\n      {\r\n        if(i+mark <= FIRSTZONE_LEDS)\r\n        {\r\n          firstZone[i+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n        if(i+10+mark <= FIRSTZONE_LEDS)\r\n        {\r\n          firstZone[i+10+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n        if(i+20+mark <= FIRSTZONE_LEDS)\r\n        {\r\n          firstZone[i+20+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n      }\r\n      if(startPosition == 2 || startPosition == 3)\r\n      {\r\n        if(i+mark <= FIRSTZONE_LEDS)\r\n        {\r\n          firstZone[i+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n        if(i+10+mark <= FIRSTZONE_LEDS)\r\n        {\r\n          firstZone[i+10+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n        if(i+20+mark <= FIRSTZONE_LEDS)\r\n        {\r\n          firstZone[i+20+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n      }\r\n      if(startPosition == 4 || startPosition == 5)\r\n      {\r\n        if(i+mark <= FIRSTZONE_LEDS)\r\n        {\r\n          firstZone[i+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n        if(i+10+mark <= FIRSTZONE_LEDS)\r\n        {\r\n          firstZone[i+10+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n        if(i+20+mark <= FIRSTZONE_LEDS)\r\n        {\r\n          firstZone[i+20+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\nvoid BPM_firstZone()\r\n{\r\n  if((red1*2) > (green1 + blue1))\r\n  {\r\n    CRGBPalette16 palette_firstZone = LavaColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < FIRSTZONE_LEDS; i++) \r\n    {\r\n      firstZone[i] = ColorFromPalette(palette_firstZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((green1*2) > (red1 + blue1))\r\n  {\r\n    CRGBPalette16 palette_firstZone = ForestColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < FIRSTZONE_LEDS; i++) \r\n    {\r\n      firstZone[i] = ColorFromPalette(palette_firstZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((blue1*2) > (green1 + red1))\r\n  {\r\n    CRGBPalette16 palette_firstZone = CloudColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < FIRSTZONE_LEDS; i++) \r\n    {\r\n      firstZone[i] = ColorFromPalette(palette_firstZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((blue1*2) == (green1 + red1))\r\n  {\r\n    CRGBPalette16 palette_firstZone = PartyColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < FIRSTZONE_LEDS; i++) \r\n    {\r\n      firstZone[i] = ColorFromPalette(palette_firstZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n}\r\n\r\nvoid Twinkle_firstZone()\r\n{\r\n  fadeToBlackBy( firstZone, FIRSTZONE_LEDS, 80);\r\n  for( int i = 0; i < FIRSTZONE_LEDS-5; i+=5)\r\n  {\r\n    if(i <= FIRSTZONE_LEDS)\r\n    {\r\n      if (random8() > twinkleChance)\r\n      {\r\n        firstZone[i] = CRGB( red1, green1, blue1);\r\n      }\r\n      else\r\n      {\r\n        firstZone[i] = CRGB( 150, 100, 40);\r\n      }  \r\n    }\r\n  }                     \r\n}\r\n\r\nvoid Eyes_firstZone()\r\n{\r\n  unsigned int chance = random8();\r\n  if( chance > eyeChance) \r\n  {\r\n    unsigned int eye = random16(FIRSTZONE_LEDS);  \r\n    firstZone[eye] = CRGB(red1,green1,blue1);\r\n    firstZone[eye-4] = CRGB(red1,green1,blue1);\r\n  }\r\n  if( chance > 39) \r\n  {\r\n    fadeToBlackBy( firstZone, FIRSTZONE_LEDS, 10);\r\n  }\r\n}\r\n\r\nvoid Solid_firstZone()\r\n{\r\n  fill_solid(firstZone, FIRSTZONE_LEDS, CRGB(red1, green1, blue1));\r\n}\r\n\r\nvoid Locator_firstZone()\r\n{\r\n  if(locatorLED <= FIRSTZONE_LEDS)\r\n  {\r\n    fill_solid(firstZone, FIRSTZONE_LEDS, CRGB::Black); \r\n    firstZone[locatorLED]=CRGB(red1, green1, blue1);\r\n  }\r\n}\r\n\r\n#ifdef ZONEONE_SECTION1_START\r\nvoid fire_firstZone_SECTION1()\r\n{\r\n  static byte heat[ZONEONE_SECTION1_END - ZONEONE_SECTION1_START];\r\n  for( int i = 0; i < ZONEONE_SECTION1_END - ZONEONE_SECTION1_START; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / ZONEONE_SECTION1_END - ZONEONE_SECTION1_START) + 2));\r\n  }\r\n\r\n  for( int k= ZONEONE_SECTION1_END - ZONEONE_SECTION1_START - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < ZONEONE_SECTION1_END - ZONEONE_SECTION1_START; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (ZONEONE_SECTION1_END - ZONEONE_SECTION1_START -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEONE_SECTION1_START_FIRE == 1\r\n    if(thisFlame <=  ZONEONE_SECTION1_END - ZONEONE_SECTION1_START )\r\n    {\r\n      firstZone[ZONEONE_SECTION1_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEONE_SECTION1_END_FIRE == 1\r\n    if(thisFlame <=  ZONEONE_SECTION1_END - ZONEONE_SECTION1_START )\r\n    {\r\n      firstZone[ZONEONE_SECTION1_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEONE_SECTION2_START\r\nvoid fire_firstZone_SECTION2()\r\n{\r\n  const int sizeOfSection = ZONEONE_SECTION2_END - ZONEONE_SECTION2_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEONE_SECTION2_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION2_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEONE_SECTION2_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION2_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEONE_SECTION3_START\r\nvoid fire_firstZone_SECTION3()\r\n{\r\n  const int sizeOfSection = ZONEONE_SECTION3_END - ZONEONE_SECTION3_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEONE_SECTION3_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION3_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEONE_SECTION3_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION3_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEONE_SECTION4_START\r\nvoid fire_firstZone_SECTION4()\r\n{\r\n  const int sizeOfSection = ZONEONE_SECTION4_END - ZONEONE_SECTION4_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEONE_SECTION4_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION4_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEONE_SECTION4_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION4_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEONE_SECTION5_START\r\nvoid fire_firstZone_SECTION5()\r\n{\r\n  const int sizeOfSection = ZONEONE_SECTION5_END - ZONEONE_SECTION5_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEONE_SECTION5_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION5_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEONE_SECTION5_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION5_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEONE_SECTION6_START\r\nvoid fire_firstZone_SECTION6()\r\n{\r\n  const int sizeOfSection = ZONEONE_SECTION6_END - ZONEONE_SECTION6_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEONE_SECTION6_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION6_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEONE_SECTION6_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION6_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEONE_SECTION7_START\r\nvoid fire_firstZone_SECTION7()\r\n{\r\n  const int sizeOfSection = ZONEONE_SECTION7_END - ZONEONE_SECTION7_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEONE_SECTION7_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION7_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEONE_SECTION7_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION7_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEONE_SECTION8_START\r\nvoid fire_firstZone_SECTION8()\r\n{\r\n  const int sizeOfSection = ZONEONE_SECTION8_END - ZONEONE_SECTION8_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEONE_SECTION8_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION8_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEONE_SECTION8_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION8_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEONE_SECTION9_START\r\nvoid fire_firstZone_SECTION9()\r\n{\r\n  const int sizeOfSection = ZONEONE_SECTION9_END - ZONEONE_SECTION9_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEONE_SECTION9_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION9_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEONE_SECTION9_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      firstZone[ZONEONE_SECTION9_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#endif\r\n\r\n/*****************  secondZone Animations  ****************************************/\r\n/*****************  secondZone Animations  ****************************************/\r\n/*****************  secondZone Animations  ****************************************/\r\n/*****************  secondZone Animations  ****************************************/\r\n/*****************  secondZone Animations  ****************************************/\r\n\r\n#if ZONETWO == 1  \r\n\r\nvoid Ripple_secondZone()\r\n{\r\n  for (int i = 0; i < SECONDZONE_LEDS; i++)\r\n  {\r\n    secondZone[i] = CRGB((red2/75), (green2/75), (blue2/75));\r\n  }   \r\n  switch (step_secondZone) \r\n  {\r\n    case -1:                                                          \r\n      center_secondZone = random16(SECONDZONE_LEDS);\r\n      step_secondZone = 0;\r\n      break;\r\n    case 0:\r\n      secondZone[center_secondZone] = CRGB(red1, green1, blue1);                          \r\n      step_secondZone ++;\r\n      break;\r\n    case 12:                                                   \r\n      step_secondZone = -1;\r\n      break;\r\n    default:                                                             // Middle of the ripples.\r\n      secondZone[(center_secondZone + step_secondZone + SECONDZONE_LEDS) % SECONDZONE_LEDS] += CRGB((red1/(step_secondZone * 5)), (green1/(step_secondZone * 5)), (blue1/(step_secondZone * 5)));\r\n      secondZone[(center_secondZone - step_secondZone + SECONDZONE_LEDS) % SECONDZONE_LEDS] += CRGB((red1/(step_secondZone * 5)), (green1/(step_secondZone * 5)), (blue1/(step_secondZone * 5)));\r\n      step_secondZone ++;                                                         \r\n      break;\r\n  }\r\n}\r\n\r\nvoid RGB_secondZone()\r\n{\r\n  if(startPosition < 6)\r\n  {\r\n    fadeToBlackBy( secondZone, SECONDZONE_LEDS, 80);\r\n    for(int pixel = startPosition+1; pixel < SECONDZONE_LEDS; pixel+=6)  \r\n    {\r\n      if(pixel <= SECONDZONE_LEDS)\r\n      {\r\n        secondZone[pixel] = CRGB(red1,green1,blue1);\r\n      }\r\n    }\r\n    for(int pixel = startPosition+3; pixel < SECONDZONE_LEDS; pixel+=6)\r\n    {\r\n      if(pixel <= SECONDZONE_LEDS)\r\n      {\r\n        secondZone[pixel] = CRGB(red2,green2,blue2);\r\n      }\r\n    }\r\n    for(int pixel = startPosition+5; pixel < SECONDZONE_LEDS; pixel+=6)\r\n    {\r\n      if(pixel <= SECONDZONE_LEDS)\r\n      {\r\n        secondZone[pixel] = CRGB(red3,green3,blue3);\r\n      } \r\n    }\r\n  }\r\n  if(startPosition == 1)\r\n  {\r\n    secondZone[0]=CRGB(red3,green3,blue3);\r\n  }\r\n  if(startPosition == 2)\r\n  {\r\n    secondZone[1]=CRGB(red3,green3,blue3);\r\n  }\r\n  if(startPosition == 3)\r\n  {\r\n    secondZone[2]=CRGB(red3,green3,blue3);\r\n    secondZone[0]=CRGB(red2,green2,blue2);\r\n  }\r\n  if(startPosition == 4)\r\n  {\r\n    secondZone[3]=CRGB(red3,green3,blue3);\r\n    secondZone[1]=CRGB(red2,green2,blue2);\r\n  }\r\n  if(startPosition == 5)\r\n  {\r\n    secondZone[4]=CRGB(red3,green3,blue3);\r\n    secondZone[2]=CRGB(red2,green2,blue2);\r\n    secondZone[0]=CRGB(red1,green1,blue1);\r\n  }\r\n}\r\n\r\nvoid ColorGlitter_secondZone( fract8 chanceOfGlitter) \r\n{\r\n  fadeToBlackBy( secondZone, SECONDZONE_LEDS, 2);\r\n  if(startPosition == 0)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    secondZone[ random16(SECONDZONE_LEDS) ] += CRGB::Red;\r\n    }\r\n  }\r\n  if(startPosition == 1)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    secondZone[ random16(SECONDZONE_LEDS) ] += CRGB::Orange;\r\n    }\r\n  }\r\n  if(startPosition == 2)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    secondZone[ random16(SECONDZONE_LEDS) ] += CRGB::Yellow;\r\n    }  \r\n  }\r\n  if(startPosition == 3)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    secondZone[ random16(SECONDZONE_LEDS) ] += CRGB::Green;\r\n    }\r\n  }\r\n  if(startPosition == 4)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    secondZone[ random16(SECONDZONE_LEDS) ] += CRGB::Blue;\r\n    }\r\n  }\r\n  if(startPosition == 5)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    secondZone[ random16(SECONDZONE_LEDS) ] += CRGB::Violet;\r\n    }\r\n  } \r\n}\r\n\r\nvoid SingleRace_secondZone()\r\n{\r\n  fadeToBlackBy( secondZone, SECONDZONE_LEDS, 1);\r\n  int pos = beatsin16( raceSpeed, 0, SECONDZONE_LEDS);\r\n  if(pos > previousLED_secondZone)\r\n  {\r\n    secondZone[pos] = CRGB(red1,green1,blue1);\r\n    previousLED_secondZone = pos;\r\n  }\r\n  if(pos < previousLED_secondZone)\r\n  {\r\n    secondZone[pos] = CRGB(red2,green2,blue2);\r\n    previousLED_secondZone = pos;\r\n  }                 \r\n}\r\n\r\nvoid Crash_secondZone()\r\n{\r\n  fadeToBlackBy( secondZone, SECONDZONE_LEDS, 15);\r\n  #ifdef ZONETWO_SECTION1_START\r\n  int pos_SECTION1 = beatsin16( raceSpeed, 0, (ZONETWO_SECTION1_END - ZONETWO_SECTION1_START) );\r\n  secondZone[ZONETWO_SECTION1_START + pos_SECTION1] = CRGB(red1,green1,blue1);\r\n  secondZone[ZONETWO_SECTION1_END - pos_SECTION1] = CRGB(red2,green2,blue2);\r\n  #endif\r\n\r\n  #ifdef ZONETWO_SECTION2_START\r\n  int pos_SECTION2 = beatsin16( raceSpeed, 0, (ZONETWO_SECTION2_END - ZONETWO_SECTION2_START) );\r\n  secondZone[ZONETWO_SECTION2_START + pos_SECTION2] = CRGB(red2,green2,blue2);\r\n  secondZone[ZONETWO_SECTION2_END - pos_SECTION2] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONETWO_SECTION3_START\r\n  int pos_SECTION3 = beatsin16( raceSpeed, 0, (ZONETWO_SECTION3_END - ZONETWO_SECTION3_START) );\r\n  secondZone[ZONETWO_SECTION3_START + pos_SECTION3] = CRGB(red1,green1,blue1);\r\n  secondZone[ZONETWO_SECTION3_END - pos_SECTION3] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONETWO_SECTION4_START\r\n  int pos_SECTION4 = beatsin16( raceSpeed, 0, (ZONETWO_SECTION4_END - ZONETWO_SECTION4_START) );\r\n  secondZone[ZONETWO_SECTION4_START + pos_SECTION4] = CRGB(red2,green2,blue2);\r\n  secondZone[ZONETWO_SECTION4_END - pos_SECTION4] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONETWO_SECTION5_START\r\n  int pos_SECTION5 = beatsin16( raceSpeed, 0, (ZONETWO_SECTION5_END - ZONETWO_SECTION5_START) );\r\n  secondZone[ZONETWO_SECTION5_START + pos_SECTION5] = CRGB(red1,green1,blue1);\r\n  secondZone[ZONETWO_SECTION5_END - pos_SECTION5] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONETWO_SECTION6_START\r\n  int pos_SECTION6 = beatsin16( raceSpeed, 0, (ZONETWO_SECTION6_END - ZONETWO_SECTION6_START) );\r\n  secondZone[ZONETWO_SECTION6_START + pos_SECTION6] = CRGB(red2,green2,blue2);\r\n  secondZone[ZONETWO_SECTION6_END - pos_SECTION6] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONETWO_SECTION7_START\r\n  int pos_SECTION7 = beatsin16( raceSpeed, 0, (ZONETWO_SECTION7_END - ZONETWO_SECTION7_START) );\r\n  secondZone[ZONETWO_SECTION7_START + pos_SECTION7] = CRGB(red1,green1,blue1);\r\n  secondZone[ZONETWO_SECTION7_END - pos_SECTION7] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONETWO_SECTION8_START\r\n  int pos_SECTION8 = beatsin16( raceSpeed, 0, (ZONETWO_SECTION8_END - ZONETWO_SECTION8_START) );\r\n  secondZone[ZONETWO_SECTION8_START + pos_SECTION8] = CRGB(red2,green2,blue2);\r\n  secondZone[ZONETWO_SECTION8_END - pos_SECTION8] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONETWO_SECTION9_START\r\n  int pos_SECTION9 = beatsin16( raceSpeed, 0, (ZONETWO_SECTION9_END - ZONETWO_SECTION9_START) );\r\n  secondZone[ZONETWO_SECTION9_START + pos_SECTION9] = CRGB(red1,green1,blue1);\r\n  secondZone[ZONETWO_SECTION9_END - pos_SECTION9] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n}\r\n\r\nvoid Rainbow_secondZone()\r\n{\r\n  fill_rainbow( secondZone, SECONDZONE_LEDS, gHue, numberOfRainbows);\r\n}\r\n\r\nvoid Blocked_secondZone()\r\n{\r\n  fadeToBlackBy( secondZone, SECONDZONE_LEDS, 2);\r\n  for( int mark = 0; mark < SECONDZONE_LEDS; mark+=30)\r\n  {\r\n    for( int i = 0; i < 9; i++) \r\n    {\r\n      if(startPosition == 0 || startPosition == 1)\r\n      {\r\n        if(i+mark <= SECONDZONE_LEDS)\r\n        {\r\n          secondZone[i+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n        if(i+10+mark <= SECONDZONE_LEDS)\r\n        {\r\n          secondZone[i+10+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n        if(i+20+mark <= SECONDZONE_LEDS)\r\n        {\r\n          secondZone[i+20+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n      }\r\n      if(startPosition == 2 || startPosition == 3)\r\n      {\r\n        if(i+mark <= SECONDZONE_LEDS)\r\n        {\r\n          secondZone[i+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n        if(i+10+mark <= SECONDZONE_LEDS)\r\n        {\r\n          secondZone[i+10+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n        if(i+20+mark <= SECONDZONE_LEDS)\r\n        {\r\n          secondZone[i+20+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n      }\r\n      if(startPosition == 4 || startPosition == 5)\r\n      {\r\n        if(i+mark <= SECONDZONE_LEDS)\r\n        {\r\n          secondZone[i+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n        if(i+10+mark <= SECONDZONE_LEDS)\r\n        {\r\n          secondZone[i+10+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n        if(i+20+mark <= SECONDZONE_LEDS)\r\n        {\r\n          secondZone[i+20+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\nvoid BPM_secondZone()\r\n{\r\n  if((red1*2) > (green1 + blue1))\r\n  {\r\n    CRGBPalette16 palette_secondZone = LavaColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < SECONDZONE_LEDS; i++) \r\n    {\r\n      secondZone[i] = ColorFromPalette(palette_secondZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((green1*2) > (red1 + blue1))\r\n  {\r\n    CRGBPalette16 palette_secondZone = ForestColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < SECONDZONE_LEDS; i++) \r\n    {\r\n      secondZone[i] = ColorFromPalette(palette_secondZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((blue1*2) > (green1 + red1))\r\n  {\r\n    CRGBPalette16 palette_secondZone = CloudColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < SECONDZONE_LEDS; i++) \r\n    {\r\n      secondZone[i] = ColorFromPalette(palette_secondZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((blue1*2) == (green1 + red1))\r\n  {\r\n    CRGBPalette16 palette_secondZone = PartyColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < SECONDZONE_LEDS; i++) \r\n    {\r\n      secondZone[i] = ColorFromPalette(palette_secondZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n}\r\n\r\nvoid Twinkle_secondZone()\r\n{\r\n  fadeToBlackBy( secondZone, SECONDZONE_LEDS, 80);\r\n  for( int i = 0; i < SECONDZONE_LEDS-5; i+=5)\r\n  {\r\n    if(i <= SECONDZONE_LEDS)\r\n    {\r\n      if (random8() > twinkleChance)\r\n      {\r\n        secondZone[i] = CRGB( red1, green1, blue1);\r\n      }\r\n      else\r\n      {\r\n        secondZone[i] = CRGB( 150, 100, 40);\r\n      }  \r\n    }\r\n  }                     \r\n}\r\n\r\nvoid Eyes_secondZone()\r\n{\r\n  unsigned int chance = random8();\r\n  if( chance > eyeChance) \r\n  {\r\n    unsigned int eye = random16(SECONDZONE_LEDS);  \r\n    secondZone[eye] = CRGB(red1,green1,blue1);\r\n    secondZone[eye-4] = CRGB(red1,green1,blue1);\r\n  }\r\n  if( chance > 39) \r\n  {\r\n    fadeToBlackBy( secondZone, SECONDZONE_LEDS, 10);\r\n  }\r\n}\r\n\r\nvoid Solid_secondZone()\r\n{\r\n  fill_solid(secondZone, SECONDZONE_LEDS, CRGB(red1, green1, blue1));\r\n}\r\n\r\nvoid Locator_secondZone()\r\n{\r\n  if(locatorLED <= SECONDZONE_LEDS)\r\n  {\r\n    fill_solid(secondZone, SECONDZONE_LEDS, CRGB::Black); \r\n    secondZone[locatorLED]=CRGB(red1, green1, blue1);\r\n  }\r\n}\r\n\r\n#ifdef ZONETWO_SECTION1_START\r\nvoid fire_secondZone_SECTION1()\r\n{\r\n  static byte heat[ZONETWO_SECTION1_END - ZONETWO_SECTION1_START];\r\n  for( int i = 0; i < ZONETWO_SECTION1_END - ZONETWO_SECTION1_START; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / ZONETWO_SECTION1_END - ZONETWO_SECTION1_START) + 2));\r\n  }\r\n\r\n  for( int k= ZONETWO_SECTION1_END - ZONETWO_SECTION1_START - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < ZONETWO_SECTION1_END - ZONETWO_SECTION1_START; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (ZONETWO_SECTION1_END - ZONETWO_SECTION1_START -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETWO_SECTION1_START_FIRE == 1\r\n    if(thisFlame <=  ZONETWO_SECTION1_END - ZONETWO_SECTION1_START )\r\n    {\r\n      secondZone[ZONETWO_SECTION1_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETWO_SECTION1_END_FIRE == 1\r\n    if(thisFlame <=  ZONETWO_SECTION1_END - ZONETWO_SECTION1_START )\r\n    {\r\n      secondZone[ZONETWO_SECTION1_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETWO_SECTION2_START\r\nvoid fire_secondZone_SECTION2()\r\n{\r\n  const int sizeOfSection = ZONETWO_SECTION2_END - ZONETWO_SECTION2_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETWO_SECTION2_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION2_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETWO_SECTION2_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION2_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETWO_SECTION3_START\r\nvoid fire_secondZone_SECTION3()\r\n{\r\n  const int sizeOfSection = ZONETWO_SECTION3_END - ZONETWO_SECTION3_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETWO_SECTION3_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION3_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETWO_SECTION3_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION3_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETWO_SECTION4_START\r\nvoid fire_secondZone_SECTION4()\r\n{\r\n  const int sizeOfSection = ZONETWO_SECTION4_END - ZONETWO_SECTION4_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETWO_SECTION4_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION4_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETWO_SECTION4_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION4_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETWO_SECTION5_START\r\nvoid fire_secondZone_SECTION5()\r\n{\r\n  const int sizeOfSection = ZONETWO_SECTION5_END - ZONETWO_SECTION5_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETWO_SECTION5_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION5_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETWO_SECTION5_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION5_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETWO_SECTION6_START\r\nvoid fire_secondZone_SECTION6()\r\n{\r\n  const int sizeOfSection = ZONETWO_SECTION6_END - ZONETWO_SECTION6_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETWO_SECTION6_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION6_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETWO_SECTION6_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION6_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETWO_SECTION7_START\r\nvoid fire_secondZone_SECTION7()\r\n{\r\n  const int sizeOfSection = ZONETWO_SECTION7_END - ZONETWO_SECTION7_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETWO_SECTION7_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION7_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETWO_SECTION7_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION7_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETWO_SECTION8_START\r\nvoid fire_secondZone_SECTION8()\r\n{\r\n  const int sizeOfSection = ZONETWO_SECTION8_END - ZONETWO_SECTION8_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETWO_SECTION8_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION8_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETWO_SECTION8_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION8_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETWO_SECTION9_START\r\nvoid fire_secondZone_SECTION9()\r\n{\r\n  const int sizeOfSection = ZONETWO_SECTION9_END - ZONETWO_SECTION9_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETWO_SECTION9_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION9_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETWO_SECTION9_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      secondZone[ZONETWO_SECTION9_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#endif\r\n\r\n/*****************  thirdZone Animations  ****************************************/\r\n/*****************  thirdZone Animations  ****************************************/\r\n/*****************  thirdZone Animations  ****************************************/\r\n/*****************  thirdZone Animations  ****************************************/\r\n/*****************  thirdZone Animations  ****************************************/\r\n\r\n#if ZONETHREE == 1\r\n\r\nvoid Ripple_thirdZone()\r\n{\r\n  for (int i = 0; i < THIRDZONE_LEDS; i++)\r\n  {\r\n    thirdZone[i] = CRGB((red2/75), (green2/75), (blue2/75));\r\n  }   \r\n  switch (step_thirdZone) \r\n  {\r\n    case -1:                                                          \r\n      center_thirdZone = random16(THIRDZONE_LEDS);\r\n      step_thirdZone = 0;\r\n      break;\r\n    case 0:\r\n      thirdZone[center_thirdZone] = CRGB(red1, green1, blue1);                          \r\n      step_thirdZone ++;\r\n      break;\r\n    case 12:                                                   \r\n      step_thirdZone = -1;\r\n      break;\r\n    default:                                                             // Middle of the ripples.\r\n      thirdZone[(center_thirdZone + step_thirdZone + THIRDZONE_LEDS) % THIRDZONE_LEDS] += CRGB((red1/(step_thirdZone * 5)), (green1/(step_thirdZone * 5)), (blue1/(step_thirdZone * 5)));\r\n      thirdZone[(center_thirdZone - step_thirdZone + THIRDZONE_LEDS) % THIRDZONE_LEDS] += CRGB((red1/(step_thirdZone * 5)), (green1/(step_thirdZone * 5)), (blue1/(step_thirdZone * 5)));\r\n      step_thirdZone ++;                                                         \r\n      break;\r\n  }\r\n}\r\n\r\nvoid RGB_thirdZone()\r\n{\r\n  if(startPosition < 6)\r\n  {\r\n    fadeToBlackBy( thirdZone, THIRDZONE_LEDS, 80);\r\n    for(int pixel = startPosition+1; pixel < THIRDZONE_LEDS; pixel+=6)  \r\n    {\r\n      if(pixel <= THIRDZONE_LEDS)\r\n      {\r\n        thirdZone[pixel] = CRGB(red1,green1,blue1);\r\n      }\r\n    }\r\n    for(int pixel = startPosition+3; pixel < THIRDZONE_LEDS; pixel+=6)\r\n    {\r\n      if(pixel <= THIRDZONE_LEDS)\r\n      {\r\n        thirdZone[pixel] = CRGB(red2,green2,blue2);\r\n      }\r\n    }\r\n    for(int pixel = startPosition+5; pixel < THIRDZONE_LEDS; pixel+=6)\r\n    {\r\n      if(pixel <= THIRDZONE_LEDS)\r\n      {\r\n        thirdZone[pixel] = CRGB(red3,green3,blue3);\r\n      } \r\n    }\r\n  }\r\n  if(startPosition == 1)\r\n  {\r\n    thirdZone[0]=CRGB(red3,green3,blue3);\r\n  }\r\n  if(startPosition == 2)\r\n  {\r\n    thirdZone[1]=CRGB(red3,green3,blue3);\r\n  }\r\n  if(startPosition == 3)\r\n  {\r\n    thirdZone[2]=CRGB(red3,green3,blue3);\r\n    thirdZone[0]=CRGB(red2,green2,blue2);\r\n  }\r\n  if(startPosition == 4)\r\n  {\r\n    thirdZone[3]=CRGB(red3,green3,blue3);\r\n    thirdZone[1]=CRGB(red2,green2,blue2);\r\n  }\r\n  if(startPosition == 5)\r\n  {\r\n    thirdZone[4]=CRGB(red3,green3,blue3);\r\n    thirdZone[2]=CRGB(red2,green2,blue2);\r\n    thirdZone[0]=CRGB(red1,green1,blue1);\r\n  }\r\n}\r\n\r\nvoid ColorGlitter_thirdZone( fract8 chanceOfGlitter) \r\n{\r\n  fadeToBlackBy( thirdZone, THIRDZONE_LEDS, 2);\r\n  if(startPosition == 0)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    thirdZone[ random16(THIRDZONE_LEDS) ] += CRGB::Red;\r\n    }\r\n  }\r\n  if(startPosition == 1)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    thirdZone[ random16(THIRDZONE_LEDS) ] += CRGB::Orange;\r\n    }\r\n  }\r\n  if(startPosition == 2)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    thirdZone[ random16(THIRDZONE_LEDS) ] += CRGB::Yellow;\r\n    }  \r\n  }\r\n  if(startPosition == 3)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    thirdZone[ random16(THIRDZONE_LEDS) ] += CRGB::Green;\r\n    }\r\n  }\r\n  if(startPosition == 4)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    thirdZone[ random16(THIRDZONE_LEDS) ] += CRGB::Blue;\r\n    }\r\n  }\r\n  if(startPosition == 5)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    thirdZone[ random16(THIRDZONE_LEDS) ] += CRGB::Violet;\r\n    }\r\n  } \r\n}\r\n\r\nvoid SingleRace_thirdZone()\r\n{\r\n  fadeToBlackBy( thirdZone, THIRDZONE_LEDS, 1);\r\n  int pos = beatsin16( raceSpeed, 0, THIRDZONE_LEDS);\r\n  if(pos > previousLED_thirdZone)\r\n  {\r\n    thirdZone[pos] = CRGB(red1,green1,blue1);\r\n    previousLED_thirdZone = pos;\r\n  }\r\n  if(pos < previousLED_thirdZone)\r\n  {\r\n    thirdZone[pos] = CRGB(red2,green2,blue2);\r\n    previousLED_thirdZone = pos;\r\n  }                 \r\n}\r\n\r\n  void Crash_thirdZone()\r\n{\r\n  fadeToBlackBy( thirdZone, THIRDZONE_LEDS, 15);\r\n  #ifdef ZONETHREE_SECTION1_START\r\n  int pos_SECTION1 = beatsin16( raceSpeed, 0, (ZONETHREE_SECTION1_END - ZONETHREE_SECTION1_START) );\r\n  thirdZone[ZONETHREE_SECTION1_START + pos_SECTION1] = CRGB(red1,green1,blue1);\r\n  thirdZone[ZONETHREE_SECTION1_END - pos_SECTION1] = CRGB(red2,green2,blue2);\r\n  #endif\r\n\r\n  #ifdef ZONETHREE_SECTION2_START\r\n  int pos_SECTION2 = beatsin16( raceSpeed, 0, (ZONETHREE_SECTION2_END - ZONETHREE_SECTION2_START) );\r\n  thirdZone[ZONETHREE_SECTION2_START + pos_SECTION2] = CRGB(red2,green2,blue2);\r\n  thirdZone[ZONETHREE_SECTION2_END - pos_SECTION2] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONETHREE_SECTION3_START\r\n  int pos_SECTION3 = beatsin16( raceSpeed, 0, (ZONETHREE_SECTION3_END - ZONETHREE_SECTION3_START) );\r\n  thirdZone[ZONETHREE_SECTION3_START + pos_SECTION3] = CRGB(red1,green1,blue1);\r\n  thirdZone[ZONETHREE_SECTION3_END - pos_SECTION3] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONETHREE_SECTION4_START\r\n  int pos_SECTION4 = beatsin16( raceSpeed, 0, (ZONETHREE_SECTION4_END - ZONETHREE_SECTION4_START) );\r\n  thirdZone[ZONETHREE_SECTION4_START + pos_SECTION4] = CRGB(red2,green2,blue2);\r\n  thirdZone[ZONETHREE_SECTION4_END - pos_SECTION4] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONETHREE_SECTION5_START\r\n  int pos_SECTION5 = beatsin16( raceSpeed, 0, (ZONETHREE_SECTION5_END - ZONETHREE_SECTION5_START) );\r\n  thirdZone[ZONETHREE_SECTION5_START + pos_SECTION5] = CRGB(red1,green1,blue1);\r\n  thirdZone[ZONETHREE_SECTION5_END - pos_SECTION5] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONETHREE_SECTION6_START\r\n  int pos_SECTION6 = beatsin16( raceSpeed, 0, (ZONETHREE_SECTION6_END - ZONETHREE_SECTION6_START) );\r\n  thirdZone[ZONETHREE_SECTION6_START + pos_SECTION6] = CRGB(red2,green2,blue2);\r\n  thirdZone[ZONETHREE_SECTION6_END - pos_SECTION6] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONETHREE_SECTION7_START\r\n  int pos_SECTION7 = beatsin16( raceSpeed, 0, (ZONETHREE_SECTION7_END - ZONETHREE_SECTION7_START) );\r\n  thirdZone[ZONETHREE_SECTION7_START + pos_SECTION7] = CRGB(red1,green1,blue1);\r\n  thirdZone[ZONETHREE_SECTION7_END - pos_SECTION7] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONETHREE_SECTION8_START\r\n  int pos_SECTION8 = beatsin16( raceSpeed, 0, (ZONETHREE_SECTION8_END - ZONETHREE_SECTION8_START) );\r\n  thirdZone[ZONETHREE_SECTION8_START + pos_SECTION8] = CRGB(red2,green2,blue2);\r\n  thirdZone[ZONETHREE_SECTION8_END - pos_SECTION8] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONETHREE_SECTION9_START\r\n  int pos_SECTION9 = beatsin16( raceSpeed, 0, (ZONETHREE_SECTION9_END - ZONETHREE_SECTION9_START) );\r\n  thirdZone[ZONETHREE_SECTION9_START + pos_SECTION9] = CRGB(red1,green1,blue1);\r\n  thirdZone[ZONETHREE_SECTION9_END - pos_SECTION9] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n}\r\n\r\nvoid Rainbow_thirdZone()\r\n{\r\n  fill_rainbow( thirdZone, THIRDZONE_LEDS, gHue, numberOfRainbows);\r\n}\r\n\r\nvoid Blocked_thirdZone()\r\n{\r\n  fadeToBlackBy( thirdZone, THIRDZONE_LEDS, 2);\r\n  for( int mark = 0; mark < THIRDZONE_LEDS; mark+=30)\r\n  {\r\n    for( int i = 0; i < 9; i++) \r\n    {\r\n      if(startPosition == 0 || startPosition == 1)\r\n      {\r\n        if(i+mark <= THIRDZONE_LEDS)\r\n        {\r\n          thirdZone[i+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n        if(i+10+mark <= THIRDZONE_LEDS)\r\n        {\r\n          thirdZone[i+10+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n        if(i+20+mark <= THIRDZONE_LEDS)\r\n        {\r\n          thirdZone[i+20+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n      }\r\n      if(startPosition == 2 || startPosition == 3)\r\n      {\r\n        if(i+mark <= THIRDZONE_LEDS)\r\n        {\r\n          thirdZone[i+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n        if(i+10+mark <= THIRDZONE_LEDS)\r\n        {\r\n          thirdZone[i+10+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n        if(i+20+mark <= THIRDZONE_LEDS)\r\n        {\r\n          thirdZone[i+20+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n      }\r\n      if(startPosition == 4 || startPosition == 5)\r\n      {\r\n        if(i+mark <= THIRDZONE_LEDS)\r\n        {\r\n          thirdZone[i+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n        if(i+10+mark <= THIRDZONE_LEDS)\r\n        {\r\n          thirdZone[i+10+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n        if(i+20+mark <= THIRDZONE_LEDS)\r\n        {\r\n          thirdZone[i+20+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\nvoid BPM_thirdZone()\r\n{\r\n  if((red1*2) > (green1 + blue1))\r\n  {\r\n    CRGBPalette16 palette_thirdZone = LavaColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < THIRDZONE_LEDS; i++) \r\n    {\r\n      thirdZone[i] = ColorFromPalette(palette_thirdZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((green1*2) > (red1 + blue1))\r\n  {\r\n    CRGBPalette16 palette_thirdZone = ForestColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < THIRDZONE_LEDS; i++) \r\n    {\r\n      thirdZone[i] = ColorFromPalette(palette_thirdZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((blue1*2) > (green1 + red1))\r\n  {\r\n    CRGBPalette16 palette_thirdZone = CloudColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < THIRDZONE_LEDS; i++) \r\n    {\r\n      thirdZone[i] = ColorFromPalette(palette_thirdZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((blue1*2) == (green1 + red1))\r\n  {\r\n    CRGBPalette16 palette_thirdZone = PartyColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < THIRDZONE_LEDS; i++) \r\n    {\r\n      thirdZone[i] = ColorFromPalette(palette_thirdZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n}\r\n\r\nvoid Twinkle_thirdZone()\r\n{\r\n  fadeToBlackBy( thirdZone, THIRDZONE_LEDS, 80);\r\n  for( int i = 0; i < THIRDZONE_LEDS-5; i+=5)\r\n  {\r\n    if(i <= THIRDZONE_LEDS)\r\n    {\r\n      if (random8() > twinkleChance)\r\n      {\r\n        thirdZone[i] = CRGB( red1, green1, blue1);\r\n      }\r\n      else\r\n      {\r\n        thirdZone[i] = CRGB( 150, 100, 40);\r\n      }  \r\n    }\r\n  }                     \r\n}\r\n\r\nvoid Eyes_thirdZone()\r\n{\r\n  unsigned int chance = random8();\r\n  if( chance > eyeChance) \r\n  {\r\n    unsigned int eye = random16(THIRDZONE_LEDS);  \r\n    thirdZone[eye] = CRGB(red1,green1,blue1);\r\n    thirdZone[eye-4] = CRGB(red1,green1,blue1);\r\n  }\r\n  if( chance > 39) \r\n  {\r\n    fadeToBlackBy( thirdZone, THIRDZONE_LEDS, 10);\r\n  }\r\n}\r\n\r\nvoid Solid_thirdZone()\r\n{\r\n  fill_solid(thirdZone, THIRDZONE_LEDS, CRGB(red1, green1, blue1));\r\n}\r\n\r\nvoid Locator_thirdZone()\r\n{\r\n  if(locatorLED <= THIRDZONE_LEDS)\r\n  {\r\n    fill_solid(thirdZone, THIRDZONE_LEDS, CRGB::Black); \r\n    thirdZone[locatorLED]=CRGB(red1, green1, blue1);\r\n  }\r\n}\r\n\r\n#ifdef ZONETHREE_SECTION1_START\r\nvoid fire_thirdZone_SECTION1()\r\n{\r\n  static byte heat[ZONETHREE_SECTION1_END - ZONETHREE_SECTION1_START];\r\n  for( int i = 0; i < ZONETHREE_SECTION1_END - ZONETHREE_SECTION1_START; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / ZONETHREE_SECTION1_END - ZONETHREE_SECTION1_START) + 2));\r\n  }\r\n\r\n  for( int k= ZONETHREE_SECTION1_END - ZONETHREE_SECTION1_START - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < ZONETHREE_SECTION1_END - ZONETHREE_SECTION1_START; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (ZONETHREE_SECTION1_END - ZONETHREE_SECTION1_START -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETHREE_SECTION1_START_FIRE == 1\r\n    if(thisFlame <=  ZONETHREE_SECTION1_END - ZONETHREE_SECTION1_START )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION1_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETHREE_SECTION1_END_FIRE == 1\r\n    if(thisFlame <=  ZONETHREE_SECTION1_END - ZONETHREE_SECTION1_START )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION1_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETHREE_SECTION2_START\r\nvoid fire_thirdZone_SECTION2()\r\n{\r\n  const int sizeOfSection = ZONETHREE_SECTION2_END - ZONETHREE_SECTION2_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETHREE_SECTION2_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION2_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETHREE_SECTION2_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION2_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETHREE_SECTION3_START\r\nvoid fire_thirdZone_SECTION3()\r\n{\r\n  const int sizeOfSection = ZONETHREE_SECTION3_END - ZONETHREE_SECTION3_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETHREE_SECTION3_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION3_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETHREE_SECTION3_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION3_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETHREE_SECTION4_START\r\nvoid fire_thirdZone_SECTION4()\r\n{\r\n  const int sizeOfSection = ZONETHREE_SECTION4_END - ZONETHREE_SECTION4_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETHREE_SECTION4_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION4_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETHREE_SECTION4_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION4_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETHREE_SECTION5_START\r\nvoid fire_thirdZone_SECTION5()\r\n{\r\n  const int sizeOfSection = ZONETHREE_SECTION5_END - ZONETHREE_SECTION5_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETHREE_SECTION5_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION5_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETHREE_SECTION5_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION5_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETHREE_SECTION6_START\r\nvoid fire_thirdZone_SECTION6()\r\n{\r\n  const int sizeOfSection = ZONETHREE_SECTION6_END - ZONETHREE_SECTION6_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETHREE_SECTION6_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION6_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETHREE_SECTION6_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION6_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETHREE_SECTION7_START\r\nvoid fire_thirdZone_SECTION7()\r\n{\r\n  const int sizeOfSection = ZONETHREE_SECTION7_END - ZONETHREE_SECTION7_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETHREE_SECTION7_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION7_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETHREE_SECTION7_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION7_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETHREE_SECTION8_START\r\nvoid fire_thirdZone_SECTION8()\r\n{\r\n  const int sizeOfSection = ZONETHREE_SECTION8_END - ZONETHREE_SECTION8_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETHREE_SECTION8_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION8_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETHREE_SECTION8_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION8_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONETHREE_SECTION9_START\r\nvoid fire_thirdZone_SECTION9()\r\n{\r\n  const int sizeOfSection = ZONETHREE_SECTION9_END - ZONETHREE_SECTION9_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONETHREE_SECTION9_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION9_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONETHREE_SECTION9_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      thirdZone[ZONETHREE_SECTION9_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#endif\r\n\r\n/*****************  fourthZone Animations  ****************************************/\r\n/*****************  fourthZone Animations  ****************************************/\r\n/*****************  fourthZone Animations  ****************************************/\r\n/*****************  fourthZone Animations  ****************************************/\r\n/*****************  fourthZone Animations  ****************************************/\r\n\r\n#if ZONEFOUR == 1\r\n\r\nvoid Ripple_fourthZone()\r\n{\r\n  for (int i = 0; i < FOURTHZONE_LEDS; i++)\r\n  {\r\n    fourthZone[i] = CRGB((red2/75), (green2/75), (blue2/75));\r\n  }   \r\n  switch (step_fourthZone) \r\n  {\r\n    case -1:                                                          \r\n      center_fourthZone = random16(FOURTHZONE_LEDS);\r\n      step_fourthZone = 0;\r\n      break;\r\n    case 0:\r\n      fourthZone[center_fourthZone] = CRGB(red1, green1, blue1);                          \r\n      step_fourthZone ++;\r\n      break;\r\n    case 12:                                                   \r\n      step_fourthZone = -1;\r\n      break;\r\n    default:                                                             // Middle of the ripples.\r\n      fourthZone[(center_fourthZone + step_fourthZone + FOURTHZONE_LEDS) % FOURTHZONE_LEDS] += CRGB((red1/(step_fourthZone * 5)), (green1/(step_fourthZone * 5)), (blue1/(step_fourthZone * 5)));\r\n      fourthZone[(center_fourthZone - step_fourthZone + FOURTHZONE_LEDS) % FOURTHZONE_LEDS] += CRGB((red1/(step_fourthZone * 5)), (green1/(step_fourthZone * 5)), (blue1/(step_fourthZone * 5)));\r\n      step_fourthZone ++;                                                         \r\n      break;\r\n  }\r\n}\r\n\r\nvoid RGB_fourthZone()\r\n{\r\n  if(startPosition < 6)\r\n  {\r\n    fadeToBlackBy( fourthZone, FOURTHZONE_LEDS, 80);\r\n    for(int pixel = startPosition+1; pixel < FOURTHZONE_LEDS; pixel+=6)  \r\n    {\r\n      if(pixel <= FOURTHZONE_LEDS)\r\n      {\r\n        fourthZone[pixel] = CRGB(red1,green1,blue1);\r\n      }\r\n    }\r\n    for(int pixel = startPosition+3; pixel < FOURTHZONE_LEDS; pixel+=6)\r\n    {\r\n      if(pixel <= FOURTHZONE_LEDS)\r\n      {\r\n        fourthZone[pixel] = CRGB(red2,green2,blue2);\r\n      }\r\n    }\r\n    for(int pixel = startPosition+5; pixel < FOURTHZONE_LEDS; pixel+=6)\r\n    {\r\n      if(pixel <= FOURTHZONE_LEDS)\r\n      {\r\n        fourthZone[pixel] = CRGB(red3,green3,blue3);\r\n      } \r\n    }\r\n  }\r\n  if(startPosition == 1)\r\n  {\r\n    fourthZone[0]=CRGB(red3,green3,blue3);\r\n  }\r\n  if(startPosition == 2)\r\n  {\r\n    fourthZone[1]=CRGB(red3,green3,blue3);\r\n  }\r\n  if(startPosition == 3)\r\n  {\r\n    fourthZone[2]=CRGB(red3,green3,blue3);\r\n    fourthZone[0]=CRGB(red2,green2,blue2);\r\n  }\r\n  if(startPosition == 4)\r\n  {\r\n    fourthZone[3]=CRGB(red3,green3,blue3);\r\n    fourthZone[1]=CRGB(red2,green2,blue2);\r\n  }\r\n  if(startPosition == 5)\r\n  {\r\n    fourthZone[4]=CRGB(red3,green3,blue3);\r\n    fourthZone[2]=CRGB(red2,green2,blue2);\r\n    fourthZone[0]=CRGB(red1,green1,blue1);\r\n  }\r\n}\r\n\r\nvoid ColorGlitter_fourthZone( fract8 chanceOfGlitter) \r\n{\r\n  fadeToBlackBy( fourthZone, FOURTHZONE_LEDS, 2);\r\n  if(startPosition == 0)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    fourthZone[ random16(FOURTHZONE_LEDS) ] += CRGB::Red;\r\n    }\r\n  }\r\n  if(startPosition == 1)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    fourthZone[ random16(FOURTHZONE_LEDS) ] += CRGB::Orange;\r\n    }\r\n  }\r\n  if(startPosition == 2)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    fourthZone[ random16(FOURTHZONE_LEDS) ] += CRGB::Yellow;\r\n    }  \r\n  }\r\n  if(startPosition == 3)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    fourthZone[ random16(FOURTHZONE_LEDS) ] += CRGB::Green;\r\n    }\r\n  }\r\n  if(startPosition == 4)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    fourthZone[ random16(FOURTHZONE_LEDS) ] += CRGB::Blue;\r\n    }\r\n  }\r\n  if(startPosition == 5)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    fourthZone[ random16(FOURTHZONE_LEDS) ] += CRGB::Violet;\r\n    }\r\n  } \r\n}\r\n\r\nvoid SingleRace_fourthZone()\r\n{\r\n  fadeToBlackBy( fourthZone, FOURTHZONE_LEDS, 1);\r\n  int pos = beatsin16( raceSpeed, 0, FOURTHZONE_LEDS);\r\n  if(pos > previousLED_fourthZone)\r\n  {\r\n    fourthZone[pos] = CRGB(red1,green1,blue1);\r\n    previousLED_fourthZone = pos;\r\n  }\r\n  if(pos < previousLED_fourthZone)\r\n  {\r\n    fourthZone[pos] = CRGB(red2,green2,blue2);\r\n    previousLED_fourthZone = pos;\r\n  }                 \r\n}\r\n\r\n  void Crash_fourthZone()\r\n{\r\n  fadeToBlackBy( fourthZone, FOURTHZONE_LEDS, 15);\r\n  #ifdef ZONEFOUR_SECTION1_START\r\n  int pos_SECTION1 = beatsin16( raceSpeed, 0, (ZONEFOUR_SECTION1_END - ZONEFOUR_SECTION1_START) );\r\n  fourthZone[ZONEFOUR_SECTION1_START + pos_SECTION1] = CRGB(red1,green1,blue1);\r\n  fourthZone[ZONEFOUR_SECTION1_END - pos_SECTION1] = CRGB(red2,green2,blue2);\r\n  #endif\r\n\r\n  #ifdef ZONEFOUR_SECTION2_START\r\n  int pos_SECTION2 = beatsin16( raceSpeed, 0, (ZONEFOUR_SECTION2_END - ZONEFOUR_SECTION2_START) );\r\n  fourthZone[ZONEFOUR_SECTION2_START + pos_SECTION2] = CRGB(red2,green2,blue2);\r\n  fourthZone[ZONEFOUR_SECTION2_END - pos_SECTION2] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONEFOUR_SECTION3_START\r\n  int pos_SECTION3 = beatsin16( raceSpeed, 0, (ZONEFOUR_SECTION3_END - ZONEFOUR_SECTION3_START) );\r\n  fourthZone[ZONEFOUR_SECTION3_START + pos_SECTION3] = CRGB(red1,green1,blue1);\r\n  fourthZone[ZONEFOUR_SECTION3_END - pos_SECTION3] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONEFOUR_SECTION4_START\r\n  int pos_SECTION4 = beatsin16( raceSpeed, 0, (ZONEFOUR_SECTION4_END - ZONEFOUR_SECTION4_START) );\r\n  fourthZone[ZONEFOUR_SECTION4_START + pos_SECTION4] = CRGB(red2,green2,blue2);\r\n  fourthZone[ZONEFOUR_SECTION4_END - pos_SECTION4] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONEFOUR_SECTION5_START\r\n  int pos_SECTION5 = beatsin16( raceSpeed, 0, (ZONEFOUR_SECTION5_END - ZONEFOUR_SECTION5_START) );\r\n  fourthZone[ZONEFOUR_SECTION5_START + pos_SECTION5] = CRGB(red1,green1,blue1);\r\n  fourthZone[ZONEFOUR_SECTION5_END - pos_SECTION5] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONEFOUR_SECTION6_START\r\n  int pos_SECTION6 = beatsin16( raceSpeed, 0, (ZONEFOUR_SECTION6_END - ZONEFOUR_SECTION6_START) );\r\n  fourthZone[ZONEFOUR_SECTION6_START + pos_SECTION6] = CRGB(red2,green2,blue2);\r\n  fourthZone[ZONEFOUR_SECTION6_END - pos_SECTION6] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONEFOUR_SECTION7_START\r\n  int pos_SECTION7 = beatsin16( raceSpeed, 0, (ZONEFOUR_SECTION7_END - ZONEFOUR_SECTION7_START) );\r\n  fourthZone[ZONEFOUR_SECTION7_START + pos_SECTION7] = CRGB(red1,green1,blue1);\r\n  fourthZone[ZONEFOUR_SECTION7_END - pos_SECTION7] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONEFOUR_SECTION8_START\r\n  int pos_SECTION8 = beatsin16( raceSpeed, 0, (ZONEFOUR_SECTION8_END - ZONEFOUR_SECTION8_START) );\r\n  fourthZone[ZONEFOUR_SECTION8_START + pos_SECTION8] = CRGB(red2,green2,blue2);\r\n  fourthZone[ZONEFOUR_SECTION8_END - pos_SECTION8] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONEFOUR_SECTION9_START\r\n  int pos_SECTION9 = beatsin16( raceSpeed, 0, (ZONEFOUR_SECTION9_END - ZONEFOUR_SECTION9_START) );\r\n  fourthZone[ZONEFOUR_SECTION9_START + pos_SECTION9] = CRGB(red1,green1,blue1);\r\n  fourthZone[ZONEFOUR_SECTION9_END - pos_SECTION9] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n}\r\n\r\nvoid Rainbow_fourthZone()\r\n{\r\n  fill_rainbow( fourthZone, FOURTHZONE_LEDS, gHue, numberOfRainbows);\r\n}\r\n\r\nvoid Blocked_fourthZone()\r\n{\r\n  fadeToBlackBy( fourthZone, FOURTHZONE_LEDS, 2);\r\n  for( int mark = 0; mark < FOURTHZONE_LEDS; mark+=30)\r\n  {\r\n    for( int i = 0; i < 9; i++) \r\n    {\r\n      if(startPosition == 0 || startPosition == 1)\r\n      {\r\n        if(i+mark <= FOURTHZONE_LEDS)\r\n        {\r\n          fourthZone[i+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n        if(i+10+mark <= FOURTHZONE_LEDS)\r\n        {\r\n          fourthZone[i+10+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n        if(i+20+mark <= FOURTHZONE_LEDS)\r\n        {\r\n          fourthZone[i+20+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n      }\r\n      if(startPosition == 2 || startPosition == 3)\r\n      {\r\n        if(i+mark <= FOURTHZONE_LEDS)\r\n        {\r\n          fourthZone[i+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n        if(i+10+mark <= FOURTHZONE_LEDS)\r\n        {\r\n          fourthZone[i+10+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n        if(i+20+mark <= FOURTHZONE_LEDS)\r\n        {\r\n          fourthZone[i+20+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n      }\r\n      if(startPosition == 4 || startPosition == 5)\r\n      {\r\n        if(i+mark <= FOURTHZONE_LEDS)\r\n        {\r\n          fourthZone[i+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n        if(i+10+mark <= FOURTHZONE_LEDS)\r\n        {\r\n          fourthZone[i+10+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n        if(i+20+mark <= FOURTHZONE_LEDS)\r\n        {\r\n          fourthZone[i+20+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\nvoid BPM_fourthZone()\r\n{\r\n  if((red1*2) > (green1 + blue1))\r\n  {\r\n    CRGBPalette16 palette_fourthZone = LavaColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < FOURTHZONE_LEDS; i++) \r\n    {\r\n      fourthZone[i] = ColorFromPalette(palette_fourthZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((green1*2) > (red1 + blue1))\r\n  {\r\n    CRGBPalette16 palette_fourthZone = ForestColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < FOURTHZONE_LEDS; i++) \r\n    {\r\n      fourthZone[i] = ColorFromPalette(palette_fourthZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((blue1*2) > (green1 + red1))\r\n  {\r\n    CRGBPalette16 palette_fourthZone = CloudColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < FOURTHZONE_LEDS; i++) \r\n    {\r\n      fourthZone[i] = ColorFromPalette(palette_fourthZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((blue1*2) == (green1 + red1))\r\n  {\r\n    CRGBPalette16 palette_fourthZone = PartyColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < FOURTHZONE_LEDS; i++) \r\n    {\r\n      fourthZone[i] = ColorFromPalette(palette_fourthZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n}\r\n\r\nvoid Twinkle_fourthZone()\r\n{\r\n  fadeToBlackBy( fourthZone, FOURTHZONE_LEDS, 80);\r\n  for( int i = 0; i < FOURTHZONE_LEDS-5; i+=5)\r\n  {\r\n    if(i <= FOURTHZONE_LEDS)\r\n    {\r\n      if (random8() > twinkleChance)\r\n      {\r\n        fourthZone[i] = CRGB( red1, green1, blue1);\r\n      }\r\n      else\r\n      {\r\n        fourthZone[i] = CRGB( 150, 100, 40);\r\n      }  \r\n    }\r\n  }                     \r\n}\r\n\r\nvoid Eyes_fourthZone()\r\n{\r\n  unsigned int chance = random8();\r\n  if( chance > eyeChance) \r\n  {\r\n    unsigned int eye = random16(FOURTHZONE_LEDS);  \r\n    fourthZone[eye] = CRGB(red1,green1,blue1);\r\n    fourthZone[eye-4] = CRGB(red1,green1,blue1);\r\n  }\r\n  if( chance > 39) \r\n  {\r\n    fadeToBlackBy( fourthZone, FOURTHZONE_LEDS, 10);\r\n  }\r\n}\r\n\r\nvoid Solid_fourthZone()\r\n{\r\n  fill_solid(fourthZone, FOURTHZONE_LEDS, CRGB(red1, green1, blue1));\r\n}\r\n\r\nvoid Locator_fourthZone()\r\n{\r\n  if(locatorLED <= FOURTHZONE_LEDS)\r\n  {\r\n    fill_solid(fourthZone, FOURTHZONE_LEDS, CRGB::Black); \r\n    fourthZone[locatorLED]=CRGB(red1, green1, blue1);\r\n  }\r\n}\r\n\r\n#ifdef ZONEFOUR_SECTION1_START\r\nvoid fire_fourthZone_SECTION1()\r\n{\r\n  static byte heat[ZONEFOUR_SECTION1_END - ZONEFOUR_SECTION1_START];\r\n  for( int i = 0; i < ZONEFOUR_SECTION1_END - ZONEFOUR_SECTION1_START; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / ZONEFOUR_SECTION1_END - ZONEFOUR_SECTION1_START) + 2));\r\n  }\r\n\r\n  for( int k= ZONEFOUR_SECTION1_END - ZONEFOUR_SECTION1_START - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < ZONEFOUR_SECTION1_END - ZONEFOUR_SECTION1_START; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (ZONEFOUR_SECTION1_END - ZONEFOUR_SECTION1_START -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFOUR_SECTION1_START_FIRE == 1\r\n    if(thisFlame <=  ZONEFOUR_SECTION1_END - ZONEFOUR_SECTION1_START )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION1_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFOUR_SECTION1_END_FIRE == 1\r\n    if(thisFlame <=  ZONEFOUR_SECTION1_END - ZONEFOUR_SECTION1_START )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION1_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFOUR_SECTION2_START\r\nvoid fire_fourthZone_SECTION2()\r\n{\r\n  const int sizeOfSection = ZONEFOUR_SECTION2_END - ZONEFOUR_SECTION2_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFOUR_SECTION2_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION2_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFOUR_SECTION2_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION2_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFOUR_SECTION3_START\r\nvoid fire_fourthZone_SECTION3()\r\n{\r\n  const int sizeOfSection = ZONEFOUR_SECTION3_END - ZONEFOUR_SECTION3_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFOUR_SECTION3_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION3_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFOUR_SECTION3_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION3_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFOUR_SECTION4_START\r\nvoid fire_fourthZone_SECTION4()\r\n{\r\n  const int sizeOfSection = ZONEFOUR_SECTION4_END - ZONEFOUR_SECTION4_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFOUR_SECTION4_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION4_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFOUR_SECTION4_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION4_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFOUR_SECTION5_START\r\nvoid fire_fourthZone_SECTION5()\r\n{\r\n  const int sizeOfSection = ZONEFOUR_SECTION5_END - ZONEFOUR_SECTION5_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFOUR_SECTION5_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION5_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFOUR_SECTION5_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION5_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFOUR_SECTION6_START\r\nvoid fire_fourthZone_SECTION6()\r\n{\r\n  const int sizeOfSection = ZONEFOUR_SECTION6_END - ZONEFOUR_SECTION6_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFOUR_SECTION6_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION6_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFOUR_SECTION6_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION6_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFOUR_SECTION7_START\r\nvoid fire_fourthZone_SECTION7()\r\n{\r\n  const int sizeOfSection = ZONEFOUR_SECTION7_END - ZONEFOUR_SECTION7_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFOUR_SECTION7_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION7_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFOUR_SECTION7_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION7_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFOUR_SECTION8_START\r\nvoid fire_fourthZone_SECTION8()\r\n{\r\n  const int sizeOfSection = ZONEFOUR_SECTION8_END - ZONEFOUR_SECTION8_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFOUR_SECTION8_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION8_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFOUR_SECTION8_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION8_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFOUR_SECTION9_START\r\nvoid fire_fourthZone_SECTION9()\r\n{\r\n  const int sizeOfSection = ZONEFOUR_SECTION9_END - ZONEFOUR_SECTION9_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFOUR_SECTION9_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION9_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFOUR_SECTION9_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fourthZone[ZONEFOUR_SECTION9_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#endif\r\n\r\n/*****************  fifthZone Animations  ****************************************/\r\n/*****************  fifthZone Animations  ****************************************/\r\n/*****************  fifthZone Animations  ****************************************/\r\n/*****************  fifthZone Animations  ****************************************/\r\n/*****************  fifthZone Animations  ****************************************/\r\n\r\n#if ZONEFIVE == 1\r\n\r\nvoid Ripple_fifthZone()\r\n{\r\n  for (int i = 0; i < FIFTHZONE_LEDS; i++)\r\n  {\r\n    fifthZone[i] = CRGB((red2/75), (green2/75), (blue2/75));\r\n  }   \r\n  switch (step_fifthZone) \r\n  {\r\n    case -1:                                                          \r\n      center_fifthZone = random16(FIFTHZONE_LEDS);\r\n      step_fifthZone = 0;\r\n      break;\r\n    case 0:\r\n      fifthZone[center_fifthZone] = CRGB(red1, green1, blue1);                          \r\n      step_fifthZone ++;\r\n      break;\r\n    case 12:                                                   \r\n      step_fifthZone = -1;\r\n      break;\r\n    default:                                                             // Middle of the ripples.\r\n      fifthZone[(center_fifthZone + step_fifthZone + FIFTHZONE_LEDS) % FIFTHZONE_LEDS] += CRGB((red1/(step_fifthZone * 5)), (green1/(step_fifthZone * 5)), (blue1/(step_fifthZone * 5)));\r\n      fifthZone[(center_fifthZone - step_fifthZone + FIFTHZONE_LEDS) % FIFTHZONE_LEDS] += CRGB((red1/(step_fifthZone * 5)), (green1/(step_fifthZone * 5)), (blue1/(step_fifthZone * 5)));\r\n      step_fifthZone ++;                                                         \r\n      break;\r\n  }\r\n}\r\n\r\nvoid RGB_fifthZone()\r\n{\r\n  if(startPosition < 6)\r\n  {\r\n    fadeToBlackBy( fifthZone, FIFTHZONE_LEDS, 80);\r\n    for(int pixel = startPosition+1; pixel < FIFTHZONE_LEDS; pixel+=6)  \r\n    {\r\n      if(pixel <= FIFTHZONE_LEDS)\r\n      {\r\n        fifthZone[pixel] = CRGB(red1,green1,blue1);\r\n      }\r\n    }\r\n    for(int pixel = startPosition+3; pixel < FIFTHZONE_LEDS; pixel+=6)\r\n    {\r\n      if(pixel <= FIFTHZONE_LEDS)\r\n      {\r\n        fifthZone[pixel] = CRGB(red2,green2,blue2);\r\n      }\r\n    }\r\n    for(int pixel = startPosition+5; pixel < FIFTHZONE_LEDS; pixel+=6)\r\n    {\r\n      if(pixel <= FIFTHZONE_LEDS)\r\n      {\r\n        fifthZone[pixel] = CRGB(red3,green3,blue3);\r\n      } \r\n    }\r\n  }\r\n  if(startPosition == 1)\r\n  {\r\n    fifthZone[0]=CRGB(red3,green3,blue3);\r\n  }\r\n  if(startPosition == 2)\r\n  {\r\n    fifthZone[1]=CRGB(red3,green3,blue3);\r\n  }\r\n  if(startPosition == 3)\r\n  {\r\n    fifthZone[2]=CRGB(red3,green3,blue3);\r\n    fifthZone[0]=CRGB(red2,green2,blue2);\r\n  }\r\n  if(startPosition == 4)\r\n  {\r\n    fifthZone[3]=CRGB(red3,green3,blue3);\r\n    fifthZone[1]=CRGB(red2,green2,blue2);\r\n  }\r\n  if(startPosition == 5)\r\n  {\r\n    fifthZone[4]=CRGB(red3,green3,blue3);\r\n    fifthZone[2]=CRGB(red2,green2,blue2);\r\n    fifthZone[0]=CRGB(red1,green1,blue1);\r\n  }\r\n}\r\n\r\nvoid ColorGlitter_fifthZone( fract8 chanceOfGlitter) \r\n{\r\n  fadeToBlackBy( fifthZone, FIFTHZONE_LEDS, 2);\r\n  if(startPosition == 0)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    fifthZone[ random16(FIFTHZONE_LEDS) ] += CRGB::Red;\r\n    }\r\n  }\r\n  if(startPosition == 1)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    fifthZone[ random16(FIFTHZONE_LEDS) ] += CRGB::Orange;\r\n    }\r\n  }\r\n  if(startPosition == 2)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    fifthZone[ random16(FIFTHZONE_LEDS) ] += CRGB::Yellow;\r\n    }  \r\n  }\r\n  if(startPosition == 3)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    fifthZone[ random16(FIFTHZONE_LEDS) ] += CRGB::Green;\r\n    }\r\n  }\r\n  if(startPosition == 4)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    fifthZone[ random16(FIFTHZONE_LEDS) ] += CRGB::Blue;\r\n    }\r\n  }\r\n  if(startPosition == 5)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    fifthZone[ random16(FIFTHZONE_LEDS) ] += CRGB::Violet;\r\n    }\r\n  } \r\n}\r\n\r\nvoid SingleRace_fifthZone()\r\n{\r\n  fadeToBlackBy( fifthZone, FIFTHZONE_LEDS, 1);\r\n  int pos = beatsin16( raceSpeed, 0, FIFTHZONE_LEDS);\r\n  if(pos > previousLED_fifthZone)\r\n  {\r\n    fifthZone[pos] = CRGB(red1,green1,blue1);\r\n    previousLED_fifthZone = pos;\r\n  }\r\n  if(pos < previousLED_fifthZone)\r\n  {\r\n    fifthZone[pos] = CRGB(red2,green2,blue2);\r\n    previousLED_fifthZone = pos;\r\n  }                 \r\n}\r\n\r\n  void Crash_fifthZone()\r\n{\r\n  fadeToBlackBy( fifthZone, FIFTHZONE_LEDS, 15);\r\n  #ifdef ZONEFIVE_SECTION1_START\r\n  int pos_SECTION1 = beatsin16( raceSpeed, 0, (ZONEFIVE_SECTION1_END - ZONEFIVE_SECTION1_START) );\r\n  fifthZone[ZONEFIVE_SECTION1_START + pos_SECTION1] = CRGB(red1,green1,blue1);\r\n  fifthZone[ZONEFIVE_SECTION1_END - pos_SECTION1] = CRGB(red2,green2,blue2);\r\n  #endif\r\n\r\n  #ifdef ZONEFIVE_SECTION2_START\r\n  int pos_SECTION2 = beatsin16( raceSpeed, 0, (ZONEFIVE_SECTION2_END - ZONEFIVE_SECTION2_START) );\r\n  fifthZone[ZONEFIVE_SECTION2_START + pos_SECTION2] = CRGB(red2,green2,blue2);\r\n  fifthZone[ZONEFIVE_SECTION2_END - pos_SECTION2] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONEFIVE_SECTION3_START\r\n  int pos_SECTION3 = beatsin16( raceSpeed, 0, (ZONEFIVE_SECTION3_END - ZONEFIVE_SECTION3_START) );\r\n  fifthZone[ZONEFIVE_SECTION3_START + pos_SECTION3] = CRGB(red1,green1,blue1);\r\n  fifthZone[ZONEFIVE_SECTION3_END - pos_SECTION3] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONEFIVE_SECTION4_START\r\n  int pos_SECTION4 = beatsin16( raceSpeed, 0, (ZONEFIVE_SECTION4_END - ZONEFIVE_SECTION4_START) );\r\n  fifthZone[ZONEFIVE_SECTION4_START + pos_SECTION4] = CRGB(red2,green2,blue2);\r\n  fifthZone[ZONEFIVE_SECTION4_END - pos_SECTION4] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONEFIVE_SECTION5_START\r\n  int pos_SECTION5 = beatsin16( raceSpeed, 0, (ZONEFIVE_SECTION5_END - ZONEFIVE_SECTION5_START) );\r\n  fifthZone[ZONEFIVE_SECTION5_START + pos_SECTION5] = CRGB(red1,green1,blue1);\r\n  fifthZone[ZONEFIVE_SECTION5_END - pos_SECTION5] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONEFIVE_SECTION6_START\r\n  int pos_SECTION6 = beatsin16( raceSpeed, 0, (ZONEFIVE_SECTION6_END - ZONEFIVE_SECTION6_START) );\r\n  fifthZone[ZONEFIVE_SECTION6_START + pos_SECTION6] = CRGB(red2,green2,blue2);\r\n  fifthZone[ZONEFIVE_SECTION6_END - pos_SECTION6] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONEFIVE_SECTION7_START\r\n  int pos_SECTION7 = beatsin16( raceSpeed, 0, (ZONEFIVE_SECTION7_END - ZONEFIVE_SECTION7_START) );\r\n  fifthZone[ZONEFIVE_SECTION7_START + pos_SECTION7] = CRGB(red1,green1,blue1);\r\n  fifthZone[ZONEFIVE_SECTION7_END - pos_SECTION7] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONEFIVE_SECTION8_START\r\n  int pos_SECTION8 = beatsin16( raceSpeed, 0, (ZONEFIVE_SECTION8_END - ZONEFIVE_SECTION8_START) );\r\n  fifthZone[ZONEFIVE_SECTION8_START + pos_SECTION8] = CRGB(red2,green2,blue2);\r\n  fifthZone[ZONEFIVE_SECTION8_END - pos_SECTION8] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONEFIVE_SECTION9_START\r\n  int pos_SECTION9 = beatsin16( raceSpeed, 0, (ZONEFIVE_SECTION9_END - ZONEFIVE_SECTION9_START) );\r\n  fifthZone[ZONEFIVE_SECTION9_START + pos_SECTION9] = CRGB(red1,green1,blue1);\r\n  fifthZone[ZONEFIVE_SECTION9_END - pos_SECTION9] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n}\r\n\r\nvoid Rainbow_fifthZone()\r\n{\r\n  fill_rainbow( fifthZone, FIFTHZONE_LEDS, gHue, numberOfRainbows);\r\n}\r\n\r\nvoid Blocked_fifthZone()\r\n{\r\n  fadeToBlackBy( fifthZone, FIFTHZONE_LEDS, 2);\r\n  for( int mark = 0; mark < FIFTHZONE_LEDS; mark+=30)\r\n  {\r\n    for( int i = 0; i < 9; i++) \r\n    {\r\n      if(startPosition == 0 || startPosition == 1)\r\n      {\r\n        if(i+mark <= FIFTHZONE_LEDS)\r\n        {\r\n          fifthZone[i+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n        if(i+10+mark <= FIFTHZONE_LEDS)\r\n        {\r\n          fifthZone[i+10+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n        if(i+20+mark <= FIFTHZONE_LEDS)\r\n        {\r\n          fifthZone[i+20+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n      }\r\n      if(startPosition == 2 || startPosition == 3)\r\n      {\r\n        if(i+mark <= FIFTHZONE_LEDS)\r\n        {\r\n          fifthZone[i+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n        if(i+10+mark <= FIFTHZONE_LEDS)\r\n        {\r\n          fifthZone[i+10+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n        if(i+20+mark <= FIFTHZONE_LEDS)\r\n        {\r\n          fifthZone[i+20+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n      }\r\n      if(startPosition == 4 || startPosition == 5)\r\n      {\r\n        if(i+mark <= FIFTHZONE_LEDS)\r\n        {\r\n          fifthZone[i+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n        if(i+10+mark <= FIFTHZONE_LEDS)\r\n        {\r\n          fifthZone[i+10+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n        if(i+20+mark <= FIFTHZONE_LEDS)\r\n        {\r\n          fifthZone[i+20+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\nvoid BPM_fifthZone()\r\n{\r\n  if((red1*2) > (green1 + blue1))\r\n  {\r\n    CRGBPalette16 palette_fifthZone = LavaColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < FIFTHZONE_LEDS; i++) \r\n    {\r\n      fifthZone[i] = ColorFromPalette(palette_fifthZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((green1*2) > (red1 + blue1))\r\n  {\r\n    CRGBPalette16 palette_fifthZone = ForestColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < FIFTHZONE_LEDS; i++) \r\n    {\r\n      fifthZone[i] = ColorFromPalette(palette_fifthZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((blue1*2) > (green1 + red1))\r\n  {\r\n    CRGBPalette16 palette_fifthZone = CloudColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < FIFTHZONE_LEDS; i++) \r\n    {\r\n      fifthZone[i] = ColorFromPalette(palette_fifthZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((blue1*2) == (green1 + red1))\r\n  {\r\n    CRGBPalette16 palette_fifthZone = PartyColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < FIFTHZONE_LEDS; i++) \r\n    {\r\n      fifthZone[i] = ColorFromPalette(palette_fifthZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n}\r\n\r\nvoid Twinkle_fifthZone()\r\n{\r\n  fadeToBlackBy( fifthZone, FIFTHZONE_LEDS, 80);\r\n  for( int i = 0; i < FIFTHZONE_LEDS-5; i+=5)\r\n  {\r\n    if(i <= FIFTHZONE_LEDS)\r\n    {\r\n      if (random8() > twinkleChance)\r\n      {\r\n        fifthZone[i] = CRGB( red1, green1, blue1);\r\n      }\r\n      else\r\n      {\r\n        fifthZone[i] = CRGB( 150, 100, 40);\r\n      }  \r\n    }\r\n  }                     \r\n}\r\n\r\nvoid Eyes_fifthZone()\r\n{\r\n  unsigned int chance = random8();\r\n  if( chance > eyeChance) \r\n  {\r\n    unsigned int eye = random16(FIFTHZONE_LEDS);  \r\n    fifthZone[eye] = CRGB(red1,green1,blue1);\r\n    fifthZone[eye-4] = CRGB(red1,green1,blue1);\r\n  }\r\n  if( chance > 39) \r\n  {\r\n    fadeToBlackBy( fifthZone, FIFTHZONE_LEDS, 10);\r\n  }\r\n}\r\n\r\nvoid Solid_fifthZone()\r\n{\r\n  fill_solid(fifthZone, FIFTHZONE_LEDS, CRGB(red1, green1, blue1));\r\n}\r\n\r\nvoid Locator_fifthZone()\r\n{\r\n  if(locatorLED <= FIFTHZONE_LEDS)\r\n  {\r\n    fill_solid(fifthZone, FIFTHZONE_LEDS, CRGB::Black); \r\n    fifthZone[locatorLED]=CRGB(red1, green1, blue1);\r\n  }\r\n}\r\n\r\n#ifdef ZONEFIVE_SECTION1_START\r\nvoid fire_fifthZone_SECTION1()\r\n{\r\n  static byte heat[ZONEFIVE_SECTION1_END - ZONEFIVE_SECTION1_START];\r\n  for( int i = 0; i < ZONEFIVE_SECTION1_END - ZONEFIVE_SECTION1_START; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / ZONEFIVE_SECTION1_END - ZONEFIVE_SECTION1_START) + 2));\r\n  }\r\n\r\n  for( int k= ZONEFIVE_SECTION1_END - ZONEFIVE_SECTION1_START - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < ZONEFIVE_SECTION1_END - ZONEFIVE_SECTION1_START; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (ZONEFIVE_SECTION1_END - ZONEFIVE_SECTION1_START -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFIVE_SECTION1_START_FIRE == 1\r\n    if(thisFlame <=  ZONEFIVE_SECTION1_END - ZONEFIVE_SECTION1_START )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION1_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFIVE_SECTION1_END_FIRE == 1\r\n    if(thisFlame <=  ZONEFIVE_SECTION1_END - ZONEFIVE_SECTION1_START )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION1_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFIVE_SECTION2_START\r\nvoid fire_fifthZone_SECTION2()\r\n{\r\n  const int sizeOfSection = ZONEFIVE_SECTION2_END - ZONEFIVE_SECTION2_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFIVE_SECTION2_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION2_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFIVE_SECTION2_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION2_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFIVE_SECTION3_START\r\nvoid fire_fifthZone_SECTION3()\r\n{\r\n  const int sizeOfSection = ZONEFIVE_SECTION3_END - ZONEFIVE_SECTION3_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFIVE_SECTION3_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION3_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFIVE_SECTION3_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION3_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFIVE_SECTION4_START\r\nvoid fire_fifthZone_SECTION4()\r\n{\r\n  const int sizeOfSection = ZONEFIVE_SECTION4_END - ZONEFIVE_SECTION4_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFIVE_SECTION4_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION4_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFIVE_SECTION4_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION4_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFIVE_SECTION5_START\r\nvoid fire_fifthZone_SECTION5()\r\n{\r\n  const int sizeOfSection = ZONEFIVE_SECTION5_END - ZONEFIVE_SECTION5_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFIVE_SECTION5_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION5_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFIVE_SECTION5_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION5_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFIVE_SECTION6_START\r\nvoid fire_fifthZone_SECTION6()\r\n{\r\n  const int sizeOfSection = ZONEFIVE_SECTION6_END - ZONEFIVE_SECTION6_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFIVE_SECTION6_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION6_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFIVE_SECTION6_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION6_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFIVE_SECTION7_START\r\nvoid fire_fifthZone_SECTION7()\r\n{\r\n  const int sizeOfSection = ZONEFIVE_SECTION7_END - ZONEFIVE_SECTION7_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFIVE_SECTION7_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION7_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFIVE_SECTION7_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION7_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFIVE_SECTION8_START\r\nvoid fire_fifthZone_SECTION8()\r\n{\r\n  const int sizeOfSection = ZONEFIVE_SECTION8_END - ZONEFIVE_SECTION8_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFIVE_SECTION8_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION8_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFIVE_SECTION8_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION8_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONEFIVE_SECTION9_START\r\nvoid fire_fifthZone_SECTION9()\r\n{\r\n  const int sizeOfSection = ZONEFIVE_SECTION9_END - ZONEFIVE_SECTION9_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONEFIVE_SECTION9_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION9_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONEFIVE_SECTION9_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      fifthZone[ZONEFIVE_SECTION9_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#endif\r\n\r\n/*****************  sixthZone Animations  ****************************************/\r\n/*****************  sixthZone Animations  ****************************************/\r\n/*****************  sixthZone Animations  ****************************************/\r\n/*****************  sixthZone Animations  ****************************************/\r\n/*****************  sixthZone Animations  ****************************************/\r\n\r\n#if ZONESIX == 1\r\n\r\nvoid Ripple_sixthZone()\r\n{\r\n  for (int i = 0; i < SIXTHZONE_LEDS; i++)\r\n  {\r\n    sixthZone[i] = CRGB((red2/75), (green2/75), (blue2/75));\r\n  }   \r\n  switch (step_sixthZone) \r\n  {\r\n    case -1:                                                          \r\n      center_sixthZone = random16(SIXTHZONE_LEDS);\r\n      step_sixthZone = 0;\r\n      break;\r\n    case 0:\r\n      sixthZone[center_sixthZone] = CRGB(red1, green1, blue1);                          \r\n      step_sixthZone ++;\r\n      break;\r\n    case 12:                                                   \r\n      step_sixthZone = -1;\r\n      break;\r\n    default:                                                             // Middle of the ripples.\r\n      sixthZone[(center_sixthZone + step_sixthZone + SIXTHZONE_LEDS) % SIXTHZONE_LEDS] += CRGB((red1/(step_sixthZone * 5)), (green1/(step_sixthZone * 5)), (blue1/(step_sixthZone * 5)));\r\n      sixthZone[(center_sixthZone - step_sixthZone + SIXTHZONE_LEDS) % SIXTHZONE_LEDS] += CRGB((red1/(step_sixthZone * 5)), (green1/(step_sixthZone * 5)), (blue1/(step_sixthZone * 5)));\r\n      step_sixthZone ++;                                                         \r\n      break;\r\n  }\r\n}\r\n\r\nvoid RGB_sixthZone()\r\n{\r\n  if(startPosition < 6)\r\n  {\r\n    fadeToBlackBy( sixthZone, SIXTHZONE_LEDS, 80);\r\n    for(int pixel = startPosition+1; pixel < SIXTHZONE_LEDS; pixel+=6)  \r\n    {\r\n      if(pixel <= SIXTHZONE_LEDS)\r\n      {\r\n        sixthZone[pixel] = CRGB(red1,green1,blue1);\r\n      }\r\n    }\r\n    for(int pixel = startPosition+3; pixel < SIXTHZONE_LEDS; pixel+=6)\r\n    {\r\n      if(pixel <= SIXTHZONE_LEDS)\r\n      {\r\n        sixthZone[pixel] = CRGB(red2,green2,blue2);\r\n      }\r\n    }\r\n    for(int pixel = startPosition+5; pixel < SIXTHZONE_LEDS; pixel+=6)\r\n    {\r\n      if(pixel <= SIXTHZONE_LEDS)\r\n      {\r\n        sixthZone[pixel] = CRGB(red3,green3,blue3);\r\n      } \r\n    }\r\n  }\r\n  if(startPosition == 1)\r\n  {\r\n    sixthZone[0]=CRGB(red3,green3,blue3);\r\n  }\r\n  if(startPosition == 2)\r\n  {\r\n    sixthZone[1]=CRGB(red3,green3,blue3);\r\n  }\r\n  if(startPosition == 3)\r\n  {\r\n    sixthZone[2]=CRGB(red3,green3,blue3);\r\n    sixthZone[0]=CRGB(red2,green2,blue2);\r\n  }\r\n  if(startPosition == 4)\r\n  {\r\n    sixthZone[3]=CRGB(red3,green3,blue3);\r\n    sixthZone[1]=CRGB(red2,green2,blue2);\r\n  }\r\n  if(startPosition == 5)\r\n  {\r\n    sixthZone[4]=CRGB(red3,green3,blue3);\r\n    sixthZone[2]=CRGB(red2,green2,blue2);\r\n    sixthZone[0]=CRGB(red1,green1,blue1);\r\n  }\r\n}\r\n\r\nvoid ColorGlitter_sixthZone( fract8 chanceOfGlitter) \r\n{\r\n  fadeToBlackBy( sixthZone, SIXTHZONE_LEDS, 2);\r\n  if(startPosition == 0)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    sixthZone[ random16(SIXTHZONE_LEDS) ] += CRGB::Red;\r\n    }\r\n  }\r\n  if(startPosition == 1)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    sixthZone[ random16(SIXTHZONE_LEDS) ] += CRGB::Orange;\r\n    }\r\n  }\r\n  if(startPosition == 2)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    sixthZone[ random16(SIXTHZONE_LEDS) ] += CRGB::Yellow;\r\n    }  \r\n  }\r\n  if(startPosition == 3)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    sixthZone[ random16(SIXTHZONE_LEDS) ] += CRGB::Green;\r\n    }\r\n  }\r\n  if(startPosition == 4)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    sixthZone[ random16(SIXTHZONE_LEDS) ] += CRGB::Blue;\r\n    }\r\n  }\r\n  if(startPosition == 5)\r\n  {\r\n    if( random8() < chanceOfGlitter) \r\n    {\r\n    sixthZone[ random16(SIXTHZONE_LEDS) ] += CRGB::Violet;\r\n    }\r\n  } \r\n}\r\n\r\nvoid SingleRace_sixthZone()\r\n{\r\n  fadeToBlackBy( sixthZone, SIXTHZONE_LEDS, 1);\r\n  int pos = beatsin16( raceSpeed, 0, SIXTHZONE_LEDS);\r\n  if(pos > previousLED_sixthZone)\r\n  {\r\n    sixthZone[pos] = CRGB(red1,green1,blue1);\r\n    previousLED_sixthZone = pos;\r\n  }\r\n  if(pos < previousLED_sixthZone)\r\n  {\r\n    sixthZone[pos] = CRGB(red2,green2,blue2);\r\n    previousLED_sixthZone = pos;\r\n  }                 \r\n}\r\n\r\n  void Crash_sixthZone()\r\n{\r\n  fadeToBlackBy( sixthZone, SIXTHZONE_LEDS, 15);\r\n  #ifdef ZONESIX_SECTION1_START\r\n  int pos_SECTION1 = beatsin16( raceSpeed, 0, (ZONESIX_SECTION1_END - ZONESIX_SECTION1_START) );\r\n  sixthZone[ZONESIX_SECTION1_START + pos_SECTION1] = CRGB(red1,green1,blue1);\r\n  sixthZone[ZONESIX_SECTION1_END - pos_SECTION1] = CRGB(red2,green2,blue2);\r\n  #endif\r\n\r\n  #ifdef ZONESIX_SECTION2_START\r\n  int pos_SECTION2 = beatsin16( raceSpeed, 0, (ZONESIX_SECTION2_END - ZONESIX_SECTION2_START) );\r\n  sixthZone[ZONESIX_SECTION2_START + pos_SECTION2] = CRGB(red2,green2,blue2);\r\n  sixthZone[ZONESIX_SECTION2_END - pos_SECTION2] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONESIX_SECTION3_START\r\n  int pos_SECTION3 = beatsin16( raceSpeed, 0, (ZONESIX_SECTION3_END - ZONESIX_SECTION3_START) );\r\n  sixthZone[ZONESIX_SECTION3_START + pos_SECTION3] = CRGB(red1,green1,blue1);\r\n  sixthZone[ZONESIX_SECTION3_END - pos_SECTION3] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONESIX_SECTION4_START\r\n  int pos_SECTION4 = beatsin16( raceSpeed, 0, (ZONESIX_SECTION4_END - ZONESIX_SECTION4_START) );\r\n  sixthZone[ZONESIX_SECTION4_START + pos_SECTION4] = CRGB(red2,green2,blue2);\r\n  sixthZone[ZONESIX_SECTION4_END - pos_SECTION4] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONESIX_SECTION5_START\r\n  int pos_SECTION5 = beatsin16( raceSpeed, 0, (ZONESIX_SECTION5_END - ZONESIX_SECTION5_START) );\r\n  sixthZone[ZONESIX_SECTION5_START + pos_SECTION5] = CRGB(red1,green1,blue1);\r\n  sixthZone[ZONESIX_SECTION5_END - pos_SECTION5] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONESIX_SECTION6_START\r\n  int pos_SECTION6 = beatsin16( raceSpeed, 0, (ZONESIX_SECTION6_END - ZONESIX_SECTION6_START) );\r\n  sixthZone[ZONESIX_SECTION6_START + pos_SECTION6] = CRGB(red2,green2,blue2);\r\n  sixthZone[ZONESIX_SECTION6_END - pos_SECTION6] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONESIX_SECTION7_START\r\n  int pos_SECTION7 = beatsin16( raceSpeed, 0, (ZONESIX_SECTION7_END - ZONESIX_SECTION7_START) );\r\n  sixthZone[ZONESIX_SECTION7_START + pos_SECTION7] = CRGB(red1,green1,blue1);\r\n  sixthZone[ZONESIX_SECTION7_END - pos_SECTION7] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n  #ifdef ZONESIX_SECTION8_START\r\n  int pos_SECTION8 = beatsin16( raceSpeed, 0, (ZONESIX_SECTION8_END - ZONESIX_SECTION8_START) );\r\n  sixthZone[ZONESIX_SECTION8_START + pos_SECTION8] = CRGB(red2,green2,blue2);\r\n  sixthZone[ZONESIX_SECTION8_END - pos_SECTION8] = CRGB(red1,green1,blue1);\r\n  #endif\r\n  \r\n  #ifdef ZONESIX_SECTION9_START\r\n  int pos_SECTION9 = beatsin16( raceSpeed, 0, (ZONESIX_SECTION9_END - ZONESIX_SECTION9_START) );\r\n  sixthZone[ZONESIX_SECTION9_START + pos_SECTION9] = CRGB(red1,green1,blue1);\r\n  sixthZone[ZONESIX_SECTION9_END - pos_SECTION9] = CRGB(red2,green2,blue2);\r\n  #endif\r\n  \r\n}\r\n\r\nvoid Rainbow_sixthZone()\r\n{\r\n  fill_rainbow( sixthZone, SIXTHZONE_LEDS, gHue, numberOfRainbows);\r\n}\r\n\r\nvoid Blocked_sixthZone()\r\n{\r\n  fadeToBlackBy( sixthZone, SIXTHZONE_LEDS, 2);\r\n  for( int mark = 0; mark < SIXTHZONE_LEDS; mark+=30)\r\n  {\r\n    for( int i = 0; i < 9; i++) \r\n    {\r\n      if(startPosition == 0 || startPosition == 1)\r\n      {\r\n        if(i+mark <= SIXTHZONE_LEDS)\r\n        {\r\n          sixthZone[i+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n        if(i+10+mark <= SIXTHZONE_LEDS)\r\n        {\r\n          sixthZone[i+10+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n        if(i+20+mark <= SIXTHZONE_LEDS)\r\n        {\r\n          sixthZone[i+20+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n      }\r\n      if(startPosition == 2 || startPosition == 3)\r\n      {\r\n        if(i+mark <= SIXTHZONE_LEDS)\r\n        {\r\n          sixthZone[i+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n        if(i+10+mark <= SIXTHZONE_LEDS)\r\n        {\r\n          sixthZone[i+10+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n        if(i+20+mark <= SIXTHZONE_LEDS)\r\n        {\r\n          sixthZone[i+20+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n      }\r\n      if(startPosition == 4 || startPosition == 5)\r\n      {\r\n        if(i+mark <= SIXTHZONE_LEDS)\r\n        {\r\n          sixthZone[i+mark] = CRGB(red3,green3,blue3);\r\n        }\r\n        if(i+10+mark <= SIXTHZONE_LEDS)\r\n        {\r\n          sixthZone[i+10+mark] = CRGB(red1,green1,blue1);\r\n        }\r\n        if(i+20+mark <= SIXTHZONE_LEDS)\r\n        {\r\n          sixthZone[i+20+mark] = CRGB(red2,green2,blue2);\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\nvoid BPM_sixthZone()\r\n{\r\n  if((red1*2) > (green1 + blue1))\r\n  {\r\n    CRGBPalette16 palette_sixthZone = LavaColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < SIXTHZONE_LEDS; i++) \r\n    {\r\n      sixthZone[i] = ColorFromPalette(palette_sixthZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((green1*2) > (red1 + blue1))\r\n  {\r\n    CRGBPalette16 palette_sixthZone = ForestColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < SIXTHZONE_LEDS; i++) \r\n    {\r\n      sixthZone[i] = ColorFromPalette(palette_sixthZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((blue1*2) > (green1 + red1))\r\n  {\r\n    CRGBPalette16 palette_sixthZone = CloudColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < SIXTHZONE_LEDS; i++) \r\n    {\r\n      sixthZone[i] = ColorFromPalette(palette_sixthZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n  if((blue1*2) == (green1 + red1))\r\n  {\r\n    CRGBPalette16 palette_sixthZone = PartyColors_p; \r\n    uint8_t beat = beatsin16( BeatsPerMinute, 64, 255);\r\n    for( int i = 0; i < SIXTHZONE_LEDS; i++) \r\n    {\r\n      sixthZone[i] = ColorFromPalette(palette_sixthZone, gHue+(i*2), beat-gHue+(i*10));\r\n    } \r\n  }\r\n}\r\n\r\nvoid Twinkle_sixthZone()\r\n{\r\n  fadeToBlackBy( sixthZone, SIXTHZONE_LEDS, 80);\r\n  for( int i = 0; i < SIXTHZONE_LEDS-5; i+=5)\r\n  {\r\n    if(i <= SIXTHZONE_LEDS)\r\n    {\r\n      if (random8() > twinkleChance)\r\n      {\r\n        sixthZone[i] = CRGB( red1, green1, blue1);\r\n      }\r\n      else\r\n      {\r\n        sixthZone[i] = CRGB( 150, 100, 40);\r\n      }  \r\n    }\r\n  }                     \r\n}\r\n\r\nvoid Eyes_sixthZone()\r\n{\r\n  unsigned int chance = random8();\r\n  if( chance > eyeChance) \r\n  {\r\n    unsigned int eye = random16(SIXTHZONE_LEDS);  \r\n    sixthZone[eye] = CRGB(red1,green1,blue1);\r\n    sixthZone[eye-4] = CRGB(red1,green1,blue1);\r\n  }\r\n  if( chance > 39) \r\n  {\r\n    fadeToBlackBy( sixthZone, SIXTHZONE_LEDS, 10);\r\n  }\r\n}\r\n\r\nvoid Solid_sixthZone()\r\n{\r\n  fill_solid(sixthZone, SIXTHZONE_LEDS, CRGB(red1, green1, blue1));\r\n}\r\n\r\nvoid Locator_sixthZone()\r\n{\r\n  if(locatorLED <= SIXTHZONE_LEDS)\r\n  {\r\n    fill_solid(sixthZone, SIXTHZONE_LEDS, CRGB::Black); \r\n    sixthZone[locatorLED]=CRGB(red1, green1, blue1);\r\n  }\r\n}\r\n\r\n#ifdef ZONESIX_SECTION1_START\r\nvoid fire_sixthZone_SECTION1()\r\n{\r\n  static byte heat[ZONESIX_SECTION1_END - ZONESIX_SECTION1_START];\r\n  for( int i = 0; i < ZONESIX_SECTION1_END - ZONESIX_SECTION1_START; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / ZONESIX_SECTION1_END - ZONESIX_SECTION1_START) + 2));\r\n  }\r\n\r\n  for( int k= ZONESIX_SECTION1_END - ZONESIX_SECTION1_START - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < ZONESIX_SECTION1_END - ZONESIX_SECTION1_START; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (ZONESIX_SECTION1_END - ZONESIX_SECTION1_START -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONESIX_SECTION1_START_FIRE == 1\r\n    if(thisFlame <=  ZONESIX_SECTION1_END - ZONESIX_SECTION1_START )\r\n    {\r\n      sixthZone[ZONESIX_SECTION1_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONESIX_SECTION1_END_FIRE == 1\r\n    if(thisFlame <=  ZONESIX_SECTION1_END - ZONESIX_SECTION1_START )\r\n    {\r\n      sixthZone[ZONESIX_SECTION1_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONESIX_SECTION2_START\r\nvoid fire_sixthZone_SECTION2()\r\n{\r\n  const int sizeOfSection = ZONESIX_SECTION2_END - ZONESIX_SECTION2_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONESIX_SECTION2_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION2_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONESIX_SECTION2_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION2_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONESIX_SECTION3_START\r\nvoid fire_sixthZone_SECTION3()\r\n{\r\n  const int sizeOfSection = ZONESIX_SECTION3_END - ZONESIX_SECTION3_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONESIX_SECTION3_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION3_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONESIX_SECTION3_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION3_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONESIX_SECTION4_START\r\nvoid fire_sixthZone_SECTION4()\r\n{\r\n  const int sizeOfSection = ZONESIX_SECTION4_END - ZONESIX_SECTION4_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONESIX_SECTION4_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION4_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONESIX_SECTION4_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION4_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONESIX_SECTION5_START\r\nvoid fire_sixthZone_SECTION5()\r\n{\r\n  const int sizeOfSection = ZONESIX_SECTION5_END - ZONESIX_SECTION5_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONESIX_SECTION5_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION5_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONESIX_SECTION5_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION5_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONESIX_SECTION6_START\r\nvoid fire_sixthZone_SECTION6()\r\n{\r\n  const int sizeOfSection = ZONESIX_SECTION6_END - ZONESIX_SECTION6_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONESIX_SECTION6_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION6_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONESIX_SECTION6_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION6_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONESIX_SECTION7_START\r\nvoid fire_sixthZone_SECTION7()\r\n{\r\n  const int sizeOfSection = ZONESIX_SECTION7_END - ZONESIX_SECTION7_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONESIX_SECTION7_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION7_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONESIX_SECTION7_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION7_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONESIX_SECTION8_START\r\nvoid fire_sixthZone_SECTION8()\r\n{\r\n  const int sizeOfSection = ZONESIX_SECTION8_END - ZONESIX_SECTION8_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONESIX_SECTION8_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION8_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONESIX_SECTION8_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION8_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#ifdef ZONESIX_SECTION9_START\r\nvoid fire_sixthZone_SECTION9()\r\n{\r\n  const int sizeOfSection = ZONESIX_SECTION9_END - ZONESIX_SECTION9_START;\r\n  static byte heat[sizeOfSection];\r\n  for( int i = 0; i < sizeOfSection; i++) \r\n  {\r\n    heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / sizeOfSection) + 2));\r\n  }\r\n\r\n  for( int k= sizeOfSection - 1; k >= 2; k--) \r\n  {\r\n    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;\r\n  }\r\n  if( random8() < SPARKING ) \r\n  {\r\n    int y = random8(7);\r\n    heat[y] = qadd8( heat[y], random8(160,255) );\r\n  }\r\n  for( int j = 0; j < sizeOfSection; j++) \r\n  {\r\n    byte colorindex = scale8( heat[j], 240);\r\n    CRGB color = ColorFromPalette( gPal, colorindex);\r\n    int pixelnumber;\r\n    if( gReverseDirection ) {\r\n      pixelnumber = (sizeOfSection -1) - j;\r\n    } else {\r\n      pixelnumber = j;\r\n    }\r\n    int thisFlame = ((pixelnumber * firesize)/100);\r\n    \r\n    \r\n    #if ZONESIX_SECTION9_START_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION9_START + thisFlame] = color;\r\n    }\r\n    #endif\r\n    \r\n    #if ZONESIX_SECTION9_END_FIRE == 1\r\n    if(thisFlame <=  sizeOfSection )\r\n    {\r\n      sixthZone[ZONESIX_SECTION9_END - thisFlame] = color;\r\n    }\r\n    #endif\r\n  }\r\n}\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "Holiday_Lights_2.0.yaml",
    "content": "##This version of the holiday lights code does not require the node red portion\r\n##The \"W\" slider under the main \"holiday LED\" light modifies each effect\r\n##The \"W\" slider under \"Glitter\" light modifies the frequency of glitter, the RGB selection changes the color of the glitter\r\n##The \"W\" slider under \"Lightning\" switch modifies the frequency of lightning.\r\n##You must replace the [MQTT_CLIENT_ID] with the USER_MQTT_CLIENT_NAME you specified in the arduino USER CONFIGURATION section\r\nsensor:\r\n  - platform: mqtt\r\n    name: \"Current LED\"\r\n    state_topic: \"[MQTT_CLIENT_ID]/locator\"\r\n\r\nlight:\r\n  - platform: mqtt\r\n    name: \"Holiday Lights\"\r\n    command_topic: \"[MQTT_CLIENT_ID]/power\"\r\n    state_topic: \"[MQTT_CLIENT_ID]/powerState\"\r\n    brightness_command_topic: \"[MQTT_CLIENT_ID]/brightness\"\r\n    brightness_state_topic: \"[MQTT_CLIENT_ID]/brightnessState\"\r\n    brightness_scale: 255\r\n    white_value_command_topic: \"[MQTT_CLIENT_ID]/modifier\"\r\n    white_value_state_topic: \"[MQTT_CLIENT_ID]/modifierState\"\r\n    white_value_scale: 500\r\n    effect_command_topic: \"[MQTT_CLIENT_ID]/effect\"\r\n    effect_state_topic: \"[MQTT_CLIENT_ID]/effectState\"\r\n    effect_list:\r\n      - Color_Chase\r\n      - Color_Glitter\r\n      - Single_Race\r\n      - Double_Crash\r\n      - Rainbow\r\n      - Blocked_Colors\r\n      - BPM\r\n      - Twinkle\r\n      - Fire\r\n      - Fill_Solid\r\n      - Spooky_Eyes\r\n      - LED_Locator\r\n    retain: true\r\n  - platform: mqtt\r\n    name: \"Color 1\"\r\n    command_topic: \"[MQTT_CLIENT_ID]/ColorPower\"\r\n    state_topic: \"[MQTT_CLIENT_ID]/powerState\"\r\n    rgb_command_topic: \"[MQTT_CLIENT_ID]/color1\"\r\n    rgb_state_topic: \"[MQTT_CLIENT_ID]/color1State\"\r\n    retain: true\r\n  - platform: mqtt\r\n    name: \"Color 2\"\r\n    command_topic: \"[MQTT_CLIENT_ID]/ColorPower\"\r\n    state_topic: \"[MQTT_CLIENT_ID]/powerState\"\r\n    rgb_command_topic: \"[MQTT_CLIENT_ID]/color2\"\r\n    rgb_state_topic: \"[MQTT_CLIENT_ID]/color2State\"\r\n    retain: true\r\n  - platform: mqtt\r\n    name: \"Color 3\"\r\n    command_topic: \"[MQTT_CLIENT_ID]/ColorPower\"\r\n    state_topic: \"[MQTT_CLIENT_ID]/powerState\"\r\n    rgb_command_topic: \"[MQTT_CLIENT_ID]/color3\"\r\n    rgb_state_topic: \"[MQTT_CLIENT_ID]/color3State\"\r\n    retain: true\r\n  - platform: mqtt\r\n    name: \"Glitter\"\r\n    state_topic: \"[MQTT_CLIENT_ID]/glitter/state\"\r\n    command_topic: \"[MQTT_CLIENT_ID]/addEffects\"\r\n    payload_on: \"Glitter On\"\r\n    payload_off: \"Glitter Off\"\r\n    rgb_command_topic: \"[MQTT_CLIENT_ID]/glitterColor\"\r\n    rgb_state_topic: \"[MQTT_CLIENT_ID]/glitterColorState\"\r\n    white_value_command_topic: \"[MQTT_CLIENT_ID]/glitterChance\"\r\n    white_value_state_topic: \"[MQTT_CLIENT_ID]/glitterChanceState\"\r\n    white_value_scale: 255\r\n    retain: true\r\n  - platform: mqtt\r\n    name: \"Lightning\"\r\n    state_topic: \"[MQTT_CLIENT_ID]/lightning/state\"\r\n    command_topic: \"[MQTT_CLIENT_ID]/addEffects\"\r\n    payload_on: \"Lightning On\"\r\n    payload_off: \"Lightning Off\"\r\n    white_value_command_topic: \"[MQTT_CLIENT_ID]/lightningChance\"\r\n    white_value_state_topic: \"[MQTT_CLIENT_ID]/lightningChanceState\"\r\n    white_value_scale: 500\r\n    retain: true\r\n  \r\n"
  },
  {
    "path": "README.md",
    "content": "# Holiday_LEDs_2.0\n\n## I'm leaving this repository up for reference purposes, but I highly recommend using WLED instead for your holiday lights: https://github.com/Aircoookie/WLED\n### Currently not working with ESP8266 Core 2.5.2, working on it.  For now please use 2.4.2.\n\nThis repository is to accompany my Holiday LED 2.0 youtube video:\n\n[![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/90n8cZJcFaU/0.jpg)](https://www.youtube.com/watch?v=90n8cZJcFaU)\n\nthis new version is easier to setup and can support 6 zones dynamically\n\nThe node-red portion of the configuration is no longer needed, all processing is handled in the arduino code. \n\n## Setup Instructions\nFill out the entire USER CONFIGURATION section of the code.\n\nIt is recommended that you leave at least 2 zones enabled, leaving only a single zone seems to result in jittery animations. \n\n## SK6812 RGBW Use\n\nThis library is a drop in replacement for FastLED: https://github.com/coryking/FastLED?fbclid=IwAR2wB4Y355hAVIkJ_OOriP5czAUnqmLCtXT8DnbRf3vbUHPRnAR-ceZjJ74\n just switch out your FastLED library folder (arduino/libraries/FastLED) with the one from that link and add #define FASTLED_RGBW at the top of the sketch.\nI also had to compile with ESP core 2.4.2, but that's an issue with my program, not the library.\n\n\n## Troubleshooting\n\n-If you get a linker error while compiling in arduino, update your ESP8266 boards manager\n\n-Fire animations are not currently working, I made a couple errors when making them modular, I will fix when I get a couple hours to devote to it.\n\n\n## Home Assistant YAML\n\n```yaml\n##This version of the holiday lights code does not require the node red portion\n##The \"W\" slider under the main \"holiday LED\" light modifies each effect\n##The \"W\" slider under \"Glitter\" light modifies the frequency of glitter, the RGB selection changes the color of the glitter\n##The \"W\" slider under \"Lightning\" switch modifies the frequency of lightning.\n##You must replace the [MQTT_CLIENT_ID] with the USER_MQTT_CLIENT_NAME you specified in the arduino USER CONFIGURATION section\nsensor:\n  - platform: mqtt\n    name: \"Current LED\"\n    state_topic: \"[MQTT_CLIENT_ID]/locator\"\n\nlight:\n  - platform: mqtt\n    name: \"Holiday Lights\"\n    command_topic: \"[MQTT_CLIENT_ID]/power\"\n    state_topic: \"[MQTT_CLIENT_ID]/powerState\"\n    brightness_command_topic: \"[MQTT_CLIENT_ID]/brightness\"\n    brightness_state_topic: \"[MQTT_CLIENT_ID]/brightnessState\"\n    brightness_scale: 255\n    white_value_command_topic: \"[MQTT_CLIENT_ID]/modifier\"\n    white_value_state_topic: \"[MQTT_CLIENT_ID]/modifierState\"\n    white_value_scale: 500\n    effect_command_topic: \"[MQTT_CLIENT_ID]/effect\"\n    effect_state_topic: \"[MQTT_CLIENT_ID]/effectState\"\n    effect_list:\n      - Color_Chase\n      - Color_Glitter\n      - Single_Race\n      - Double_Crash\n      - Rainbow\n      - Blocked_Colors\n      - BPM\n      - Twinkle\n      - Fire\n      - Fill_Solid\n      - Spooky_Eyes\n      - LED_Locator\n    retain: true\n  - platform: mqtt\n    name: \"Color 1\"\n    command_topic: \"[MQTT_CLIENT_ID]/ColorPower\"\n    state_topic: \"[MQTT_CLIENT_ID]/powerState\"\n    rgb_command_topic: \"[MQTT_CLIENT_ID]/color1\"\n    rgb_state_topic: \"[MQTT_CLIENT_ID]/color1State\"\n    retain: true\n  - platform: mqtt\n    name: \"Color 2\"\n    command_topic: \"[MQTT_CLIENT_ID]/ColorPower\"\n    state_topic: \"[MQTT_CLIENT_ID]/powerState\"\n    rgb_command_topic: \"[MQTT_CLIENT_ID]/color2\"\n    rgb_state_topic: \"[MQTT_CLIENT_ID]/color2State\"\n    retain: true\n  - platform: mqtt\n    name: \"Color 3\"\n    command_topic: \"[MQTT_CLIENT_ID]/ColorPower\"\n    state_topic: \"[MQTT_CLIENT_ID]/powerState\"\n    rgb_command_topic: \"[MQTT_CLIENT_ID]/color3\"\n    rgb_state_topic: \"[MQTT_CLIENT_ID]/color3State\"\n    retain: true\n  - platform: mqtt\n    name: \"Glitter\"\n    state_topic: \"[MQTT_CLIENT_ID]/glitter/state\"\n    command_topic: \"[MQTT_CLIENT_ID]/addEffects\"\n    payload_on: \"Glitter On\"\n    payload_off: \"Glitter Off\"\n    rgb_command_topic: \"[MQTT_CLIENT_ID]/glitterColor\"\n    rgb_state_topic: \"[MQTT_CLIENT_ID]/glitterColorState\"\n    white_value_command_topic: \"[MQTT_CLIENT_ID]/glitterChance\"\n    white_value_state_topic: \"[MQTT_CLIENT_ID]/glitterChanceState\"\n    white_value_scale: 255\n    retain: true\n  - platform: mqtt\n    name: \"Lightning\"\n    state_topic: \"[MQTT_CLIENT_ID]/lightning/state\"\n    command_topic: \"[MQTT_CLIENT_ID]/addEffects\"\n    payload_on: \"Lightning On\"\n    payload_off: \"Lightning Off\"\n    white_value_command_topic: \"[MQTT_CLIENT_ID]/lightningChance\"\n    white_value_state_topic: \"[MQTT_CLIENT_ID]/lightningChanceState\"\n    white_value_scale: 500\n    retain: true\n  ```\n## OpenHAB Support\n\nFor Openhab 2.4 support take a look at the addditions here (sitemap, things, rules and items files):\nhttps://github.com/JayJayJanssen/openhab-MQTTv2-LED-strip\n"
  }
]