 
   if(EL == 0 && XEL == 0)
   {
-    Fire(55,120,5);
+    Fire2012WithPalette(); // run simulation frame, using palette colors
+    FastLED.show(); // display this frame
+    FastLED.delay(1000 / FRAMES_PER_SECOND);
   }
   else
   {
     if(Transmit)
     {
-      allSet(strip.Color(50,50,50),10);
-      strip.show();
+      //allSet(CRGB::Black);
+      leds[stickone[index]] = CRGB::White;
+      leds[sticktwo[index]] = CRGB::White;
+      leds[stickthree[index]] = CRGB::White;
+      leds[stickfour[index]] = CRGB::White;
+      leds[stickone[index]].fadeLightBy(brightness);
+      leds[sticktwo[index]].fadeLightBy(brightness);
+      leds[stickthree[index]].fadeLightBy(brightness);
+      leds[stickfour[index]].fadeLightBy(brightness);
+      
+      //allSet(strip.Color(50,50,50),10);
+      FastLED.show();
+      delay(100);
+      index++;
+      if(index >= 8)
+      {
+        index = 0;
+        brightness = brightness + fadeAmount;
+        // reverse the direction of the fading at the ends of the fade: 
+        if(brightness == 0 || brightness == 255)
+        {
+          fadeAmount = -fadeAmount ; 
+        } 
+      }
+      Serial.println("Transmitting");
     }
     else
     {
-      allSet(strip.Color(50,0,0),10);
-      strip.show();
+      allSet(CRGB::Black);
+      //allSet(strip.Color(50,0,0),10);
+      FastLED.show();
     }
   }
 

    }
  }
}
void allSet(uint32_t c, uint8_t wait) 
{
  for(uint16_t i=0; i<strip.numPixels(); i++) 
  {
    strip.setPixelColor(i, c);
    strip.show();
    delay(wait);
  }
}
void Fire(int Cooling, int Sparking, int SpeedDelay) {
  static byte heat[60];
  int cooldown;
  
  // Step 1.  Cool down every cell a little
  for( int i = 0; i < strip.numPixels(); i++) {
    cooldown = random(0, ((Cooling * 10) / strip.numPixels()) + 2);
    
    if(cooldown>heat[i]) {
      heat[i]=0;
    } else {
      heat[i]=heat[i]-cooldown;
    }
  }
  
  // Step 2.  Heat from each cell drifts 'up' and diffuses a little
  for( int k= strip.numPixels() - 1; k >= 2; k--) {
    heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2]) / 3;
  }
    
  // Step 3.  Randomly ignite new 'sparks' near the bottom
  if( random(255) < Sparking ) {
    int y = random(7);
    heat[y] = heat[y] + random(160,255);
    //heat[y] = random(160,255);
  }

  // Step 4.  Convert heat to LED colors
  for( int j = 0; j < strip.numPixels(); j++) {
    setPixelHeatColor(j, heat[j] );
  }

  strip.show();
  delay(SpeedDelay);
}

void setPixelHeatColor (int Pixel, byte temperature) {
  // Scale 'heat' down from 0-255 to 0-191
  byte t192 = round((temperature/255.0)*191);
 
  // calculate ramp up from
  byte heatramp = t192 & 0x3F; // 0..63
  heatramp <<= 2; // scale up to 0..252
 
  // figure out which third of the spectrum we're in:
  if( t192 > 0x80) {                     // hottest
    strip.setPixelColor(Pixel, random(0,256), random(0,256), random(0,256));
  } else if( t192 > 0x40 ) {             // middle
    strip.setPixelColor(Pixel, random(0,256), random(0,256), 0);
  } else {                               // coolest
    strip.setPixelColor(Pixel, heatramp, 0, 0);
  }
}

#include <FastLED.h>
#include <Servo.h>
#include <string.h>

#define NUM_LEDS 32
#define DATA_PIN 6
#define BRIGHTNESS  200
#define FRAMES_PER_SECOND 60
CRGBPalette16 gPal;
CRGB leds[NUM_LEDS];
//Connect USB port to Pi USB Port

//Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, 6, NEO_GRB + NEO_KHZ800);
Servo XEL_servo;
Servo EL_servo;
bool gReverseDirection = false;
const int ledBluePin = 13;
String test;
int EL = 0;
