Difference between revisions of "LED lamp"

From Fixme.ch
Jump to: navigation, search
(Created page with " <code> #include <FastLED.h> #define NUM_LEDS 25 #define DATA_PIN 6 CRGB leds[NUM_LEDS]; void setup() { FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); } void lo...")
(No difference)

Revision as of 23:01, 13 February 2023

  1. include <FastLED.h>
  1. define NUM_LEDS 25
  2. define DATA_PIN 6

CRGB leds[NUM_LEDS];

void setup() {

   FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);

}

void loop() {

 leds[0] = CRGB::Red;
 FastLED.show();
 delay(500);
 
 // Now turn the LED off, then pause
 leds[0] = CRGB::Black;
 FastLED.show();
 delay(500);

}