abooseca

Untitled

Nov 16th, 2023
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <FastLED.h>
  2. #define LED_PIN 2
  3. #define NUM_LEDS 5
  4.  
  5.  
  6.  
  7.  
  8. void setup () {
  9.   FastLED.addLeds<WS2812, LED_PIN, RGB>(leds, NUM_LEDS);
  10.   FastLED.setMaxPowerInVoltsAndMilliamps(5, 500);
  11.   FastLED.clear();
  12.   FastLED.show();
  13.  
  14. }
  15.  
  16. void loop() {
  17.   Leds[0] = CRGB(255, 0, 0);
  18.   Leds[1] = CRGB(0, 255, 0);
  19.   Leds[2] = CRGB(0, 0, 255);
  20.   FastLED.show();
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment