I have built this project: https://www.youtube.com/watch?v=duiAbLsXZSE It is a Lithophane lamp, 3D printed. A friend has this built and it works perfectly. The one I built was using the exact same links to buy all the parts. The function is to light up the lamp remotely using a phone app which can change the colors from all on white or any color picked from a color selector. Also a slider to change the stepper motor speed. The led strip in my friends lamp have all the leds light up exactly the same. My led strips light up with a repeating by 3 sequence. If my friends controller is connected to my led strip it also lights up wrong. I have not hooked my controller to his light strip yet. But logic dictates the problem is not my controller because his controller gives the same result with my lights. Are these defective or the wrong type? They were supposed to be ws2811b 5V strips. The second problem with the strips (I purchased two) was that only the first 45 of 60 led's lit up. The last 15 were not lit, voltage at the end of the strip was 5V.
Here is the sketch code:
#include <Adafruit_NeoPixel.h>
#include <SPI.h>
#include <BlynkSimpleEsp8266.h>
#include <ESP8266WiFi.h>
#include <Stepper.h>
#define PIN D2
#define NUMPIXELS 60
#define BLYNK_PRINT Serial
int motorSpeed;
int motorDirection;
const int stepsPerRevolution = 4096;
BlynkTimer timer;
Stepper myStepper(stepsPerRevolution, 14, 12, 13, 15);
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void stepperControl() {
if (motorSpeed > 0) {
if (motorDirection == 0) { // Rotate Clockwise
myStepper.step(stepsPerRevolution / 50);
} else { // Rotate CounterClockwise
myStepper.step(-stepsPerRevolution / 50);
}
}
}
void setup()
{
Serial.begin(9600);
timer.setInterval(1, stepperControl);
Blynk.begin("H9uwVJelnjeAEpjfIhNKe3VdwCb3ERZO", "SilentRunning", "Spectre972zpr4");
pixels.begin();
pixels.setBrightness(55);
}
void loop()
{
Blynk.run();
timer.run();
}
BLYNK_WRITE(V0)
{
motorSpeed = param.asInt();
myStepper.setSpeed(motorSpeed);
}
BLYNK_WRITE(V2)
{
int R = param[0].asInt();
int G = param[1].asInt();
int B = param[2].asInt();
Serial.println(R);
Serial.println(G);
Serial.println(B);
for (int i = 0; i < NUMPIXELS; i++) {
pixels.setPixelColor(i, pixels.Color(R, G, B));
pixels.show();
}
}