Hey guys after looking on google for a while I don’t fine any answers to my problem.
I just made a led lamp with an ESP8266 , I found this project on YouTube.
Here is the code
#include <dummy.h>
#include "FastLED.h"
#include <BlynkSimpleEsp8266.h>
#define BLYNK_PRINT Serial
#define FASTLED_ESP8266_RAW_PIN_ORDER
#define NOMBRE_DE_LEDS 60
#define LED_TYPE WS2812
#define COLOR_ORDER GRB
#define PIN1 2
CRGB leds1[NOMBRE_DE_LEDS];
char auth[] = "vO6SJswC_yELPuQkoQylJJqwqiOv3CvK";
char ssid[] = "RENAUD-HP_Network";
char pass[] = "kathy2125";
int data=255;
int r,g,b;
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
FastLED.addLeds<LED_TYPE, PIN1, COLOR_ORDER>(leds1, NOMBRE_DE_LEDS).setCorrection( TypicalLEDStrip );
}
BLYNK_WRITE(V1)
{
r = param[0].asInt();
g = param[1].asInt();
b = param[2].asInt();
static1(r, g, b,data);
}
void loop()
{
Blynk.run();
}
BLYNK_WRITE(V2)
{
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 < NOMBRE_DE_LEDS; i++ )
{
leds1[i] = CRGB(r, g, b);
}
FastLED.show();
}
I would like to use shortcut in my Iphone
I use get URL adressIP/token/update/V2?value=0 to switch off and
adressIP/token/update/V2?value=255 to switch on
but I would like to use it to make the color change with the pin V1
I don’t find how to do that
Thanks all for your help