What logic level shifter did you use for your LED data signal? Iām trying something similar, but Iām having difficulty getting any sort of response out of my LEDs with a Wemos D1 R2 (3.3V DO).
- Iāve verified the LEDs are performing correctly with an UNO.
- Iāve verified D5 on the Wemos is the correct pin and matches with my code.
- Iāve put a 3.3v to 5v bi-directional shifter in and verified the LED still works on D5.
But, whenever I un-wire the LED and replace it with the WS2812B strip, I donāt even get a peep out of the LEDs. Also just for experimentation I tried without a resistor in the data signal line and also feeding the leds directly with the 3.3v signal, but neither worked.
Here is the code Iām trying to run:
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <FastLED.h>
#include <SimpleTimer.h>
// How many leds in your strip?
#define NUM_LEDS 70
#define DATA_PIN 14
CRGB leds[NUM_LEDS];
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "XXXXXXXXXX";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "XXXXXXXXXX";
char pass[] = "XXXXXXXXXX";
int varonoff;
int i = 0;
SimpleTimer timer;
void setup()
{
//Serial.begin(9600);
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
Blynk.begin(auth, ssid, pass);
timer.setInterval(50L, chase);
timer.setInterval(1000L,senduptime);
}
void loop()
{
Blynk.run();
timer.run(); // Initiates SimpleTimer
}
void chase() {
leds[i - 3] = CHSV( 224, 255, 0);
leds[i - 2] = CHSV( 224, 255, 50);
leds[i - 1] = CHSV( 224, 255, 150);
leds[i] = CHSV( 224, 255, 255);
leds[i + 1] = CHSV( 224, 255, 150);
leds[i + 2] = CHSV( 224, 255, 50);
leds[i + 3] = CHSV( 224, 255, 0);
FastLED.show();
i++;
if (i == 70){
i = 0;
}
}
void senduptime(){
Blynk.virtualWrite(V20, millis() / 1000);
}
This code works on the UNO (modified of course to remove all of the blynk stuff) and I know the code is running on the Wemos, because the uptime is updating correctly on the app.
Any help is appreciated!
Edit: updated code. See below.