Guest User

new

a guest
Feb 2nd, 2023
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. #include <FastLED.h> // Uses FastLED Library to drive WS2812B 'Neopixel' LEDs
  2.  
  3. #define LED_PIN D4 // The pin connected to Data In on the strip
  4. #define NUM_LEDS 5 // Number of LED's on your strip
  5. #define LED_BRIGHTNESS 50 // set Brightness value
  6. #define MILLI_AMPS 2400 // Maximum current your power source can deliver in mA
  7. #define CONNECTION_COLOR 0xFF4500 // Purple WiFi connection status color
  8. CRGB leds[NUM_LEDS];
  9. void setup() {
  10. Serial.begin(115200);
  11. FastLED.addLeds<WS2811, LED_PIN, RGB>(leds, NUM_LEDS);
  12. FastLED.setDither(false);
  13. FastLED.setBrightness(LED_BRIGHTNESS);
  14. FastLED.setMaxPowerInVoltsAndMilliamps(5, MILLI_AMPS);
  15. }
  16.  
  17.  
  18. void loop() {
  19. leds[0] = CRGB::White; FastLED.show(); delay(3000);
  20. leds[0] = CRGB::Red; FastLED.show(); delay(3000);
  21. leds[1] = CRGB::White; FastLED.show(); delay(3000);
  22. leds[1] = CRGB::Red; FastLED.show(); delay(3000);
  23. leds[2] = CRGB::White; FastLED.show(); delay(3000);
  24. leds[2] = CRGB::Red; FastLED.show(); delay(3000);
  25. leds[3] = CRGB::White; FastLED.show(); delay(3000);
  26. leds[3] = CRGB::Red; FastLED.show(); delay(3000);
  27. leds[4] = CRGB::White; FastLED.show(); delay(3000);
  28. leds[4] = CRGB::Red; FastLED.show(); delay(3000);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment