diff --git a/FAQ-#3.md b/FAQ-#3.md index ba1f9f3..51808f7 100644 --- a/FAQ-#3.md +++ b/FAQ-#3.md @@ -39,12 +39,17 @@ void setup() { ... } -void PixelCountChanged(uint16_t newCount) { +bool PixelCountChanged(uint16_t newCount) { if (strip != NULL) { delete strip; // delete the previous dynamically created strip } strip = new NeoPixelBus(newCount, Pin); // and recreate with new count + if (strip == NULL) { + Serial.println("OUT OF MEMORY"); + return false; + } strip->Begin(); + return true; } void loop() {