Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastLED.h>
- int r = 0;
- int g = 0;
- int b = 0;
- #define LED_PIN 5
- #define NUM_LEDS 16
- CRGB leds[NUM_LEDS];
- void setup() {
- FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
- }
- void loop()
- {
- c1();
- c2();
- }
- void c1() {//White
- for (int i = 0; i < NUM_LEDS; i++)
- {
- leds[i] = CRGB (100, 100, 100);
- }
- FastLED.show();
- delay(1000);
- }
- void c2() {//Red
- for (int i = 0; i < NUM_LEDS; i++)
- {
- leds[i] = CRGB (255, 0, 0);
- }
- FastLED.show();
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement