-->
Page 1 of 1

NODEMCU Neopixel RGBW PWM problem

PostPosted: Sun Mar 25, 2018 4:41 pm
by MPC
Hello Newbie here just dipping my toe.

The Project I am working on is control of a strip of digital addressable LEDs. The weird thing is, I have no problem controlling the strip from an Arduino Nano using the Neopixel library, but, i cant seem to use the same process from my NodeMCU board. I have checked the voltage out to the LED strip (4.99v) and I have also tried to use a logic shifter to make sure the PWM data is high enough. Measuting the voltage from the Nano and the NodeMCU it looks the same.

Does anyone have any ideas?

My end goal is to have the NodeMCU control my LED strip from an MQTT Broker

I have included my simple code, when looking at the serial console i can see the "start" and "finish" lines repeating and the onboard LED is flashing which is conected to pin16 showing there is some PWM (albeit inverted i think)

Code: Select all#include <Adafruit_NeoPixel.h>

#define PIN 16

// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(30, PIN, NEO_RGBW + NEO_KHZ800);

//strip.setPixelColor(Pixel number, green, red, blue, White);

void setup() {
  Serial.begin(9600);
  pinMode(PIN, OUTPUT);
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}



void loop() {
    Serial.println("Start");       // print as an ASCII-encoded decimal

for (int i=0; i <= 50; i++){
delay(10);
strip.setPixelColor(i, 100, 100, 255, 255);
strip.show();
}

    Serial.println("Finish");       // print as an ASCII-encoded decimal
 
}