diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/Multiple/OctoWS2811Demo/OctoWS2811Demo.ino | 37 | ||||
-rw-r--r-- | examples/Multiple/ParallelOutputDemo/ParallelOutputDemo.ino | 7 |
2 files changed, 40 insertions, 4 deletions
diff --git a/examples/Multiple/OctoWS2811Demo/OctoWS2811Demo.ino b/examples/Multiple/OctoWS2811Demo/OctoWS2811Demo.ino new file mode 100644 index 00000000..6aad445d --- /dev/null +++ b/examples/Multiple/OctoWS2811Demo/OctoWS2811Demo.ino @@ -0,0 +1,37 @@ +#define USE_OCTOWS2811 +#include<OctoWS2811.h> +#include<FastLED.h> + +#define NUM_LEDS_PER_STRIP 64 +#define NUM_STRIPS 8 + +CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP]; + +// Pin layouts on the teensy 3: +// OctoWS2811: 2,14,7,8,6,20,21,5 + +void setup() { + LEDS.addLeds<OCTOWS2811>(leds, NUM_LEDS_PER_STRIP); + LEDS.setBrightness(32); +} + +void loop() { + static uint8_t hue = 0; + for(int i = 0; i < NUM_STRIPS; i++) { + for(int j = 0; j < NUM_LEDS_PER_STRIP; j++) { + leds[(i*NUM_LEDS_PER_STRIP) + j] = CHSV((32*i) + hue+j,192,255); + } + } + + // Set the first n leds on each strip to show which strip it is + for(int i = 0; i < NUM_STRIPS; i++) { + for(int j = 0; j <= i; j++) { + leds[(i*NUM_LEDS_PER_STRIP) + j] = CRGB::Red; + } + } + + hue++; + + LEDS.show(); + LEDS.delay(10); +} diff --git a/examples/Multiple/ParallelOutputDemo/ParallelOutputDemo.ino b/examples/Multiple/ParallelOutputDemo/ParallelOutputDemo.ino index 8705761f..d575c9c6 100644 --- a/examples/Multiple/ParallelOutputDemo/ParallelOutputDemo.ino +++ b/examples/Multiple/ParallelOutputDemo/ParallelOutputDemo.ino @@ -16,12 +16,11 @@ CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP]; // void setup() { -// LEDS.addLeds<WS2811_PORTA,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP); -// LEDS.addLeds<WS2811_PORTB,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP); -// LEDS.addLeds<WS2811_PORTC,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP); + // LEDS.addLeds<WS2811_PORTA,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP); + // LEDS.addLeds<WS2811_PORTB,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP); + // LEDS.addLeds<WS2811_PORTC,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP); LEDS.addLeds<WS2811_PORTD,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP); - FastPin<0>::setOutput(); LEDS.setBrightness(32); } |