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...")
 
(Test code)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
 +
== Intro ==
  
<code>
+
Idea from https://www.thingiverse.com/thing:2873557.
 +
 
 +
== Test code ==
 +
 
 +
<pre>
 
#include <FastLED.h>
 
#include <FastLED.h>
  
Line 22: Line 27:
 
   delay(500);
 
   delay(500);
 
}
 
}
</code>
+
</pre>
 +
 
 +
Note: micropython equivalent: https://docs.micropython.org/en/latest/library/neopixel.html

Latest revision as of 03:01, 14 February 2023

Intro

Idea from https://www.thingiverse.com/thing:2873557.

Test 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 loop() { 
  leds[0] = CRGB::Red;
  FastLED.show();
  delay(500);
  
  // Now turn the LED off, then pause
  leds[0] = CRGB::Black;
  FastLED.show();
  delay(500);
}

Note: micropython equivalent: https://docs.micropython.org/en/latest/library/neopixel.html