From fbbfd3f4a6ea507bb81dcd69aaa0f1427c6600f4 Mon Sep 17 00:00:00 2001 From: Gregg Date: Mon, 21 Feb 2022 10:57:35 -0600 Subject: [PATCH] Update Pixel tutorial to refresh update() twice on initialization for DotStar Seems to be required to "sync" LEDs --- Other Examples/Pixel/Pixel.ino | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Other Examples/Pixel/Pixel.ino b/Other Examples/Pixel/Pixel.ino index f32643a..8f121d7 100644 --- a/Other Examples/Pixel/Pixel.ino +++ b/Other Examples/Pixel/Pixel.ino @@ -51,10 +51,11 @@ #elif defined(CONFIG_IDF_TARGET_ESP32C3) - #define NEOPIXEL_RGB_PIN 8 - #define NEOPIXEL_RGBW_PIN 2 - #define DOTSTAR_DATA_PIN 0 - #define DOTSTAR_CLOCK_PIN 1 + #define NEOPIXEL_RGB_PIN 0 + #define NEOPIXEL_RGBW_PIN 3 + #define DOTSTAR_DATA_PIN 7 + #define DOTSTAR_CLOCK_PIN 2 + #define DEVICE_SUFFIX "-C3" #endif @@ -149,6 +150,7 @@ struct DotStar_RGB : Service::LightBulb { // Addressable two-wire RGB LED S pixel=new Dot(dataPin,clockPin); // creates Dot LED on specified pins this->nPixels=nPixels; // save number of Pixels in this LED Strand update(); // manually call update() to set pixel with restored initial values + update(); // call second update() a second time - DotStar seems to need to be "refreshed" upon start-up } boolean update() override { @@ -164,8 +166,8 @@ struct DotStar_RGB : Service::LightBulb { // Addressable two-wire RGB LED S float hueStep=360.0/nPixels; // step size for change in hue from one pixel to the next for(int i=0;iset(color,nPixels); // set the colors according to the array return(true);