Advertisement
elektronek

ESP8266 FastLed error - solved

Apr 9th, 2024 (edited)
944
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Arduino 0.63 KB | Source Code | 0 0
  1. #include <FastLED.h>
  2. #define NUM_LEDS 1
  3. #define DATA_PIN D0
  4. CRGB leds[NUM_LEDS];
  5.  
  6. void setup() {
  7.   FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
  8.   FastLED.clear(true);  // vyresilo cely problem pridani tohoto radku!
  9.   leds[0] = 0x202020;   // ma byt bilá, cili RGB ale sviti pouze RG !
  10.   FastLED.show();
  11.   delay(2000);
  12. }
  13.  
  14. void loop() {
  15.   leds[0] = 0x200000;   // Red OK
  16.   FastLED.show();
  17.   delay(500);
  18.  
  19.   leds[0] = 0x002000;   // Green OK
  20.   FastLED.show();
  21.   delay(500);
  22.  
  23.   leds[0] = 0x000020;   // Blue OK
  24.   FastLED.show();
  25.   delay(500);
  26.  
  27.   leds[0] = 0x202020;   // White OK
  28.   FastLED.show();
  29.   delay(500);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement