Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //VIA YOUTUBE : EMAKERZ
- //LINK OF MY VIDEO : https://youtu.be/7QHd0KTtKYA
- #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[] = "code blynk (reçu par mail)";
- char ssid[] = "nom de votre réseau wifi";
- char pass[] = "MDP WIFI";
- 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();
- }
Add Comment
Please, Sign In to add comment