-->
Page 1 of 2

Using IO12 on ESP-12e for ws2811 LED Question

PostPosted: Sat Jun 08, 2019 4:18 pm
by Jeremy
Hi,

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!
Jeremy


Code: Select all#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif

// 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)
  statusLED.begin();
}



void loop() {
  pixels.clear(); // Set all pixel colors to 'off'
  statusLED.setPixelColor(0, statusLED.Color(255, 0, 0));
  statusLED.show();   // 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));

    pixels.show();   // Send the updated pixel colors to the hardware.

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

Re: Using IO12 on ESP-12e for ws2811 LED Question

PostPosted: Sat Jun 08, 2019 5:51 pm
by rudy
It looks like it should work to me. Can you comment out the code for pixels, see if if statusLED alone will work?

Re: Using IO12 on ESP-12e for ws2811 LED Question

PostPosted: Sat Jun 08, 2019 6:30 pm
by Jeremy
Hi Rudy,

Thanks for your comment! I tried that already with no success. I'm wondering if maybe I have a bad pin on 12......

Re: Using IO12 on ESP-12e for ws2811 LED Question

PostPosted: Sat Jun 08, 2019 6:38 pm
by rudy
Can you try it on a different pin, like 13 or 14?