Advertisement
Guest User

Untitled

a guest
Dec 13th, 2022
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <FastLED.h>
  2.  
  3. #define DATA_PIN    7
  4. #define NUM_LEDS    6
  5. #define BRIGHTNESS  64
  6. #define LED_TYPE    WS2812B
  7. #define COLOR_ORDER GRB
  8.  
  9. // Define the array of leds
  10. CRGB leds[NUM_LEDS];
  11.  
  12. #define UPDATES_PER_SECOND 100
  13.  
  14. void setup() {
  15.   FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);
  16.   FastLED.setBrightness(BRIGHTNESS);
  17. }
  18.  
  19. void loop() {
  20.   // Turn the LED on
  21.   //leds[0] = CRGB::Red;
  22.   //leds[1] = CRGB::Green;
  23.   //leds[2] = CRGB::Blue;
  24.   leds[0] = CRGB(50, 100, 150);
  25.   FastLED.show();
  26.   delay(1000);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement