diff options
author | Daniel Garcia <danielgarcia@gmail.com> | 2014-01-21 09:12:56 +0400 |
---|---|---|
committer | Daniel Garcia <danielgarcia@gmail.com> | 2014-01-21 09:12:56 +0400 |
commit | 0757fd59034ca7f8fdc8fa779923426c447e9206 (patch) | |
tree | 28a268a0a47e1a2e8f47008613d9fe8bfa2745fb /examples | |
parent | 4db5cba81454e2c66aeeab72e29a419ccae47ecb (diff) | |
parent | ed8c33d914b707e4b1c8d43c8f21a2936110ad85 (diff) |
merge from mainline release
Diffstat (limited to 'examples')
-rw-r--r-- | examples/Blink/Blink.ino | 4 | ||||
-rw-r--r-- | examples/Cylon/Cylon.ino | 2 | ||||
-rw-r--r-- | examples/FirstLight/FirstLight.ino | 7 | ||||
-rw-r--r-- | examples/testleds/testleds.pde | 95 |
4 files changed, 7 insertions, 101 deletions
diff --git a/examples/Blink/Blink.ino b/examples/Blink/Blink.ino index 6e5c6173..bc5c84d2 100644 --- a/examples/Blink/Blink.ino +++ b/examples/Blink/Blink.ino @@ -6,7 +6,7 @@ // 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 DATA_PIN 3 #define CLOCK_PIN 13 // Define the array of leds @@ -20,7 +20,7 @@ void setup() { // 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<NEOPIXEL, DATA_PIN, RGB>(leds, NUM_LEDS); // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS); // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS); diff --git a/examples/Cylon/Cylon.ino b/examples/Cylon/Cylon.ino index 96b6ac59..bec878c5 100644 --- a/examples/Cylon/Cylon.ino +++ b/examples/Cylon/Cylon.ino @@ -5,7 +5,7 @@ // 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 +// ground, and power), like the LPD8806, define both DATA_PIN and CLOCK_PIN #define DATA_PIN 11 #define CLOCK_PIN 13 diff --git a/examples/FirstLight/FirstLight.ino b/examples/FirstLight/FirstLight.ino index 8f82c370..dff123b9 100644 --- a/examples/FirstLight/FirstLight.ino +++ b/examples/FirstLight/FirstLight.ino @@ -1,6 +1,7 @@ // Use if you want to force the software SPI subsystem to be used for some reason (generally, you don't) // #define FORCE_SOFTWARE_SPI // Use if you want to force non-accelerated pin access (hint: you really don't, it breaks lots of things) +// #define FORCE_SOFTWARE_SPI // #define FORCE_SOFTWARE_PINS #include "FastLED.h" @@ -31,16 +32,16 @@ void setup() { // 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, GRB>(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<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS); // FastLED.addLeds<NEOPIXEL, DATA_PIN, RGB>(leds, NUM_LEDS); // FastLED.addLeds<WS2811_400, DATA_PIN, RGB>(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<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); diff --git a/examples/testleds/testleds.pde b/examples/testleds/testleds.pde deleted file mode 100644 index 7a0e088b..00000000 --- a/examples/testleds/testleds.pde +++ /dev/null @@ -1,95 +0,0 @@ -#include <FastSPI_LED.h> - -#define NUM_LEDS 150 - -// Sometimes chipsets wire in a backwards sort of way -struct CRGB { unsigned char b; unsigned char r; unsigned char g; }; -// struct CRGB { unsigned char r; unsigned char g; unsigned char b; }; -struct CRGB *leds; - -#define PIN 4 - -void setup() -{ - FastSPI_LED.setLeds(NUM_LEDS); - FastSPI_LED.setChipset(CFastSPI_LED::SPI_SM16716); - //FastSPI_LED.setChipset(CFastSPI_LED::SPI_TM1809); - //FastSPI_LED.setChipset(CFastSPI_LED::SPI_LPD6803); - //FastSPI_LED.setChipset(CFastSPI_LED::SPI_HL1606); - //FastSPI_LED.setChipset(CFastSPI_LED::SPI_595); - //FastSPI_LED.setChipset(CFastSPI_LED::SPI_WS2801); - - FastSPI_LED.setPin(PIN); - - FastSPI_LED.init(); - FastSPI_LED.start(); - - leds = (struct CRGB*)FastSPI_LED.getRGBData(); -} - -void loop() { - // one at a time - for(int j = 0; j < 3; j++) { - for(int i = 0 ; i < NUM_LEDS; i++ ) { - memset(leds, 0, NUM_LEDS * 3); - switch(j) { - case 0: leds[i].r = 255; break; - case 1: leds[i].g = 255; break; - case 2: leds[i].b = 255; break; - } - FastSPI_LED.show(); - delay(10); - } - } - - // growing/receeding bars - for(int j = 0; j < 3; j++) { - memset(leds, 0, NUM_LEDS * 3); - for(int i = 0 ; i < NUM_LEDS; i++ ) { - switch(j) { - case 0: leds[i].r = 255; break; - case 1: leds[i].g = 255; break; - case 2: leds[i].b = 255; break; - } - FastSPI_LED.show(); - delay(10); - } - for(int i = NUM_LEDS-1 ; i >= 0; i-- ) { - switch(j) { - case 0: leds[i].r = 0; break; - case 1: leds[i].g = 0; break; - case 2: leds[i].b = 0; break; - } - FastSPI_LED.show(); - delay(1); - } - } - - // Fade in/fade out - for(int j = 0; j < 3; j++ ) { - memset(leds, 0, NUM_LEDS * 3); - for(int k = 0; k < 256; k++) { - for(int i = 0; i < NUM_LEDS; i++ ) { - switch(j) { - case 0: leds[i].r = k; break; - case 1: leds[i].g = k; break; - case 2: leds[i].b = k; break; - } - } - FastSPI_LED.show(); - delay(3); - } - for(int k = 255; k >= 0; k--) { - for(int i = 0; i < NUM_LEDS; i++ ) { - switch(j) { - case 0: leds[i].r = k; break; - case 1: leds[i].g = k; break; - case 2: leds[i].b = k; break; - } - } - FastSPI_LED.show(); - delay(3); - } - } -} - |