 // 2. Heat drifts up (a lot) and sideways (a bit)
 // 3. New 'sparks' 
 
+uint8_t loopCounter = 1;
+#ifdef SERIAL_DEBUG
+unsigned long prev_looptime;
+#endif
 void loop(){
   // Random is used a lot, so 'add entropy' here
   random16_add_entropy(random());
   
   // Execute the fire simulation function
-  FireAway();
+  if(loopCounter++ == FIRE_EVERY){
+    loopCounter = 0;
+    FireAway();
+  }
   
   // Calculate the proper LED colours
-  ColourLeds();
+  ColourLeds(loopCounter);
   
   FastLED.show();
+#ifdef SERIAL_DEBUG
+  Serial << (millis()-prev_looptime) << endl;
+  prev_looptime = millis();
+#endif
   FastLED.delay(LOOP_TIME);
 }
 


// Fire settings
#define BRIGHTNESS 180
#define LOOP_TIME 500
#define COOLING 55
#define SPARKING 120

// direct output buffer
CRGB leds[NUM_LEDS];
// Heatmap, with the 'temperature' of the fire
uint8_t heat[NUM_LEDS];
// Current colour palette
CRGBPalette16 gPal;


}

void setup(){
#ifdef SERIAL_DEBUG
  Serial.begin(57600);
  Serial << "Haardvuur.ino" << endl;
#endif
  FastLED.delay(1000);
  
  FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
  FastLED.setBrightness(BRIGHTNESS);
  //test to see if everything is working
  fill_rainbow(leds, NUM_LEDS, 0, 255/NUM_LEDS);
