mirror of
https://github.com/Makuna/NeoPixelBus.git
synced 2025-08-10 22:34:25 +02:00
Updated FAQ #3 (markdown)
@@ -41,7 +41,7 @@ void setup() {
|
|||||||
|
|
||||||
void PixelCountChanged(uint16_t newCount) {
|
void PixelCountChanged(uint16_t newCount) {
|
||||||
if (strip != NULL) {
|
if (strip != NULL) {
|
||||||
delete Strip; // delete the previous dynamically created strip
|
delete strip; // delete the previous dynamically created strip
|
||||||
}
|
}
|
||||||
strip = new NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod>(newCount, Pin); // and recreate with new count
|
strip = new NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod>(newCount, Pin); // and recreate with new count
|
||||||
strip->Begin();
|
strip->Begin();
|
||||||
@@ -52,7 +52,7 @@ void loop() {
|
|||||||
if (strip != NULL) {
|
if (strip != NULL) {
|
||||||
// some arbitrary code
|
// some arbitrary code
|
||||||
for (uint16_t pixel = 0; pixel < strip.PixelCount(); pixel++) {
|
for (uint16_t pixel = 0; pixel < strip.PixelCount(); pixel++) {
|
||||||
strip.SetPixelColor(pixel, red);
|
strip->SetPixelColor(pixel, red);
|
||||||
}
|
}
|
||||||
strip->Show();
|
strip->Show();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user