/*     RAM used (bytes) to show() 1 LED vs FastLED version

|                  | (1) #include | (2) CRGB,addLeds<> | (3) CHSV, show() | Global vars       | Flash used        |
|------------------|--------------|--------------------|------------------|-------------------|-------------------|
| (0) No FastLED   | 206          |                    |                  | 192               | 1908              |
| FastLED 3.3.3    | 219 (+13)    | 287 (+68)          | 304 (+17)        | 205/273/285       | 1938/4012/5012    |
| FastLED 3.4.0    | 219 (+13)    | 287 (+68)          | 304 (+17)        | 205/273/285       | 1938/4006/5000    |
| FastLED 3.5.0    | 219 (+13)    | 287 (+68)          | 304 (+17)        | 205/273/285       | 1938/4082/5046    |
| FastLED 3.6.0    | 219 (+13)    | 291 (+72)          | 308 (+17)        | 205/277/289       | 1938/4092/5056    |
| FastLED 3.7.0    | 219 (+13)    | 291 (+72)          | 310 (+19)        | 205/277/289       | 1938/4080/5046    |
| FastLED 3.7.1    | 219 (+13)    | 291 (+72)          | 310 (+19)        | 205/277/289       | 1938/4080/5046    |
| FastLED 3.7.2    | 219 (+13)    | 291 (+72)          | 310 (+19)        | 205/277/289       | 1938/4080/5046    |
| FastLED 3.7.3    | 219 (+13)    | 291 (+72)          | 310 (+19)        | 205/277/289       | 1938/4080/5046    |
| FastLED 3.7.4    | 219 (+13)    | 299 (+80)          | 449 (+150)       | 205/285/297       | 1938/4102/5276    |
| FastLED 3.7.5    | 219 (+13)    | 299 (+80)          | 449 (+150)       | 205/285/297       | 1938/4114/5288    |
| FastLED 3.7.6    | 219 (+13)    | 299 (+80)          | 449 (+150)       | 205/285/297       | 1938/4114/5288    |
| FastLED 3.7.7    | 219 (+13)    | 305 (+86)          | 455 (+150)       | 205/291/303       | 1938/4146/5320    |
| FastLED 3.7.8    | 219 (+13)    | 305 (+86)          | 455 (+150)       | 205/291/303       | 1946/4154/5328    |
| FastLED 3.9.0    | 223 (+17)    | 309 (+90)          | 337 (+28)        | 209/295/323       | 1946/4372/5224    |

*/

#define TEST 3

#if (TEST >= 1)
#include <FastLED.h>
#endif

#if (TEST >= 2)
CRGB led;
#endif

void setup() {
  Serial.begin(2000000);
  usedmem();
#if (TEST >= 2)
  FastLED.addLeds<NEOPIXEL, 2>(&led, 1);
#endif
}

void loop() {
#if (TEST >= 3)
  led = CHSV(random8(), random8(), random8());
  FastLED.show();
#endif
  usedmem();
  delay(500);
}

void usedmem() {
  extern unsigned int __heap_start;
  extern void *__brkval;
  uint16_t free_memory; // address used as a surrogate for the stack pointer
  if ((uint16_t)__brkval == 0)
    free_memory = ((uint16_t)&free_memory) - ((uint16_t)&__heap_start);
  else
    free_memory = ((uint16_t)&free_memory) - ((uint16_t)__brkval);
  Serial.print(F("Used mem: "));
  Serial.println(2048 - free_memory);
}