we are using the ESP32-S2 DevKit M1 v1.0 (ESP-S2-MINI-2; `XXN4R2`) and are encountering strange behavior on some of them. Instead of the on-board WS2812 Led going white when told so it will show red.
All of the other primary colors seem to work (red, blue, green).
To rule out any timing/implementation issues we have also done a quick PoC for arduino ide (we are using Rust with `esp-idf-xxx` normally) which has the same behavior.
Is this a known fact or something we can do about?
Arduino Code (Blink White):
Code: Select all
#include <Adafruit_NeoPixel.h>
#define LED_PIN 18 // GPIO connected to the WS2812 data input
#define NUM_LEDS 1 // Number of LEDs in the strip
// Initialize the NeoPixel library
Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin(); // Initialize the NeoPixel library
strip.show(); // Turn off all LEDs
}
void loop() {
// Turn the LED white
strip.setPixelColor(0, strip.Color(255, 255, 255)); // White color
strip.show(); // Update the strip
delay(500); // Wait for half a second
// Turn the LED off
strip.setPixelColor(0, strip.Color(0, 0, 0)); // Off
strip.show(); // Update the strip
delay(500); // Wait for half a second
}
Code: Select all
#include <Adafruit_NeoPixel.h>
#define LED_PIN 18 // GPIO connected to the WS2812 data input
#define NUM_LEDS 1 // Number of LEDs
Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin(); // Initialize the NeoPixel library
strip.show(); // Turn off all LEDs
}
void loop() {
rainbowCycle(10); // Run the rainbow cycle animation
}
// Rainbow Cycle Animation
void rainbowCycle(uint8_t wait) {
uint16_t i, j;
for(j=0; j<256*5; j++) { // 5 cycles of all colors on the wheel
for(i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
}
strip.show();
delay(wait);
}
}
// Input a value 0 to 255 to get a color value.
// The colors transition R -> G -> B -> back to R.
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if(WheelPos < 85) {
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
} else if(WheelPos < 170) {
WheelPos -= 85;
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
} else {
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
}