Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Garcia <danielgarcia@gmail.com>2013-11-11 07:57:05 +0400
committerDaniel Garcia <danielgarcia@gmail.com>2013-11-11 07:57:05 +0400
commit6800f7fd10eddc6778a00a48d5174413820203ac (patch)
tree4c7ee8bf0eae560077cf85c947cea1dc8fa36f26 /examples/Blink
parentd6a3acd68715f95465b883d4a8258cfd48bef5a1 (diff)
Add blink example
Diffstat (limited to 'examples/Blink')
-rw-r--r--examples/Blink/Blink.ino44
1 files changed, 44 insertions, 0 deletions
diff --git a/examples/Blink/Blink.ino b/examples/Blink/Blink.ino
new file mode 100644
index 00000000..6e5c6173
--- /dev/null
+++ b/examples/Blink/Blink.ino
@@ -0,0 +1,44 @@
+#include "FastLED.h"
+
+// How many leds in your strip?
+#define NUM_LEDS 6
+
+// For led chips like Neopixels, which have a data line, ground, and power, you just
+// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
+// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
+#define DATA_PIN 11
+#define CLOCK_PIN 13
+
+// Define the array of leds
+CRGB leds[NUM_LEDS];
+
+void setup() {
+ // Uncomment/edit one of the following lines for your leds arrangement.
+ // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
+ // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
+ // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
+ // FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
+ // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
+ // FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
+ FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
+ // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
+
+ // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
+ // FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
+ // FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);
+
+ // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
+ // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
+ // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
+}
+
+void loop() {
+ // Turn the LED on, then pause
+ leds[0] = CRGB::Red;
+ FastLED.show();
+ delay(500);
+ // Now turn the LED off, then pause
+ leds[0] = CRGB::Black;
+ FastLED.show();
+ delay(500);
+}