Hi, I need some help. I’m about to go crazy over this
I’m using this basic sketch
#define BLYNK_PRINT Serial
#include <Adafruit_NeoPixel.h>
#include <SPI.h>
#include <BlynkSimpleEsp8266.h>
#include <ESP8266WiFi.h>
#define PIN D2 // GPIO pin
#define NUMPIXELS 12 // Number of pixels in strip
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
char auth[] = "mytoken"; // You should get Auth Token in the Blynk App.
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, "Smartnet", "Pass");
pixels.begin();
}
BLYNK_WRITE(V2) // Widget WRITEs to Virtual Pin 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)); // Moderately bright green color.
pixels.show(); // This sends the updated pixel color to the hardware.
}
}
void loop()
{
Blynk.run();
}
That works fine I can control my neo pixels ring wich I have connected to my NodeMcu. On pin D2. Virtual pin 2
How do I add brightness control to all of this? so it will work with a slider from inside the blynk app?