Using IO12 on ESP-12e for ws2811 LED Question


I have a simple sketch that I am trying to get working that includes a ws2812b LED strip on the RX pin and a single ws2811 LED on pin 12 of a raw ESP-12e. I will be using almost all of the other pins for a variety of things and I am stuck with pin 12 for the single LED. For some reason I can not get the LED on pin 12 to light up. The LED strip is working fine.

Is it possible that the neopixels library doesn’t work with pin 12?

I am confident in the wiring of the single LED because it worked on another pin.

Thanks for any advice!

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>

// Which pin on the Arduino is connected to the NeoPixels?
#define PIN        3
#define STATUS       12
#define NUMPIXELS 20 // Popular NeoPixel ring size

Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_BRG + NEO_KHZ800);
Adafruit_NeoPixel statusLED(1, STATUS, NEO_BGR + NEO_KHZ800);

#define DELAYVAL 100 // Time (in milliseconds) to pause between pixels

void setup() {
  pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)

void loop() {
  pixels.clear(); // Set all pixel colors to 'off'
  statusLED.setPixelColor(0, statusLED.Color(255, 0, 0));;   // Send the updated pixel colors to the hardware.

  for (int i = 0; i < NUMPIXELS; i++) { // For each pixel...

    // pixels.Color() takes RGB values, from 0,0,0 up to 255,255,255
    // Here we're using a moderately bright green color:
    pixels.setPixelColor(i, pixels.Color(25, 0, 0));;   // Send the updated pixel colors to the hardware.

    delay(DELAYVAL); // Pause before next pass through loop

No reason it won't work on pin 12, if it works on other pins, other than you having a bad solder link or so.

By the way, why not using another WS2812B LED and place that in series with the loop? Saves you a pin.

Thanks for looking at it! I was going to do what you suggested, but the single pixel LEDs that I have are a different configuration then the 12v digital strip that I have so they are a different color. I will probably go back to that and just rearrange the color numbers in the code.

Different LEDs may have a different communication protocol, so not sure whether you can just place different types in series.

Best would be to use another WS2812B for the single pixel.

Thanks for your replies wvmarle. I switched over to pin 13 as suggested on another forum and it's working fine now. Not sure what was up with pin 12, but I'm glad to be past that hurdle.