// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID "TMPLGRiRQMUN"
#define BLYNK_DEVICE_NAME "Quickstart Device"
#define BLYNK_AUTH_TOKEN "bZrFlHlBDaNr2YxzCeRCGWZovFaeHqxI"
// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "Имя сети";
char pass[] = "Пароль сети";
#define FASTLED_ESP8266_RAW_PIN_ORDER
#include "FastLED.h"
#define NUM_LEDS1 40
#define LED_TYPE WS2812
#define COLOR_ORDER GRB
CRGB leds1[NUM_LEDS1];
#define PIN1 D1
int data=255;
int r,g,b;
void setup()
{
// Debug console
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
FastLED.addLeds<LED_TYPE, PIN1, COLOR_ORDER>(leds1, NUM_LEDS1).setCorrection( TypicalLEDStrip );
}
BLYNK_WRITE(V3)
{
r = param[0].asInt();
g = param[1].asInt();
b = param[2].asInt();
static1(r, g, b,data);
}
void loop()
{
Blynk.run();
}
BLYNK_WRITE(V1)
{
data = param.asInt();
static1(r, g, b,data);
}
void static1(int r, int g, int b,int brightness)
{
FastLED.setBrightness(brightness);
for (int i = 0; i < NUM_LEDS1; i++ )
{
leds1[i] = CRGB(r, g, b);
}
FastLED.show();
}