/* RAM used (bytes) to show() 1 LED vs FastLED version
| (1) #include | (2) CRGB,addLeds| (3) CHSV, show| Globals (1/2/3)| Flash used (1/2/3)
---------------|--------------|-----------------|---------------|----------------|-------------------
(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 (+86) | 337 (+28) | 209/295/323 | 1946/4372/5224
FastLED 3.9.1 | 223 (+17) | 309 (+86) | 337 (+28) | 209/295/323 | 1946/4372/5224
FastLED 3.9.2 | 223 (+17) | 309 (+86) | 337 (+28) | 209/295/323 | 1946/4372/5224
FastLED 3.9.3 | 223 (+17) | 309 (+86) | 337 (+28) | 209/295/323 | 1946/4372/5224
FastLED 3.9.4 | 223 (+17) | 309 (+86) | 337 (+28) | 209/295/323 | 1946/4372/5224
FastLED 3.9.5 | 223 (+17) | 306 (+83) | 334 (+28) | 209/292/320 | 1946/4314/5170
FastLED 3.9.6 | 223 (+17) | 306 (+83) | 334 (+28) | 209/292/320 | 1946/4314/5170
FastLED 3.9.7 | 223 (+17) | 306 (+83) | 334 (+28) | 209/292/320 | 1946/4314/5170
FastLED 3.9.8 | 223 (+17) | 306 (+83) | 334 (+28) | 209/292/320 | 1946/4314/5168
FastLED 3.9.9 | 223 (+17) | 306 (+83) | 334 (+28) | 209/292/320 | 1946/4314/5168
FastLED 3.9.10 | 223 (+17) | 306 (+83) | 334 (+28) | 209/292/320 | 1946/4314/5168
FastLED 3.9.11 | 223 (+17) | 306 (+83) | 334 (+28) | 209/292/320 | 1946/4314/5168
FastLED 3.9.12 | 223 (+17) | 306 (+83) | 334 (+28) | 209/292/320 | 1946/4314/5204
FastLED 3.9.13 | 223 (+17) | 306 (+83) | 334 (+28) | 209/292/320 | 1946/4314/5234
FastLED 3.9.14 | 223 (+17) | 306 (+83) | 334 (+28) | 209/292/320 | 1946/4314/5234
FastLED 3.9.15 | 223 (+17) | 306 (+83) | 334 (+28) | 209/292/320 | 1946/4314/5234
FastLED 3.9.16 | 223 (+17) | 306 (+83) | 334 (+28) | 209/292/320 | 1946/4314/5234
FastLED 3.9.17 | 1338 (+1134) | 1421 (+83) | 1449 (+28) | 869/952/980 | 6424/8792/9712
FastLED 3.9.18 | ? hangs | 766 (+??) | 794 (+28) | 222/305/333 | 5168/7536/8456
FastLED 0f9da86| 223 (+17) | 306 (+83) | 334 (+28) | 209/292/320 | 1948/4314/5234
FastLED 3.9.19 | 223 (+17) | 306 (+83) | 334 (+28) | 209/292/320 | 1946/4314/5234
FastLED 3.9.20 | 223 (+17) | 306 (+83) | 334 (+28) | 209/292/320 | 1946/4314/5234
*/
#define TEST 3
#if (TEST >= 1)
#include <FastLED.h>
#endif
#if (TEST >= 2)
CRGB leds[1];
#endif
void setup() {
Serial.begin(2000000);
usedmem();
#if (TEST >= 2)
FastLED.addLeds<NEOPIXEL, 2>(leds, 1);
#endif
}
void loop() {
#if (TEST >= 3)
leds[0] = 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);
}