Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Uncomment this line if you have any interrupts that are changing pins - this causes the library to be a little bit more cautious
- // #define FAST_SPI_INTERRUPTS_WRITE_PINS 1
- // Uncomment this line to force always using software, instead of hardware, SPI (why?)
- // #define FORCE_SOFTWARE_SPI 1
- // Uncomment this line if you want to talk to DMX controllers
- // #define FASTSPI_USE_DMX_SIMPLE 1
- #include "FastLED.h"
- #define NUM_LEDS 50
- #define DATA_PIN 6
- #define CLOCK_PIN 8
- CRGB yourcolor = 0xff0000; //fade to this
- void setup() {
- // sanity check delay - allows reprogramming if accidently blowing power w/leds
- delay(2000);
- // For safety (to prevent too high of a power draw), the test case defaults to
- // setting brightness to 25% brightness
- LEDS.setBrightness(64);
- FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
- // LEDS.addLeds<WS2811, 13>(leds, NUM_LEDS);
- // LEDS.addLeds<TM1809, 13>(leds, NUM_LEDS);
- // LEDS.addLeds<UCS1903, 13>(leds, NUM_LEDS);
- // LEDS.addLeds<TM1803, 13>(leds, NUM_LEDS);
- // LEDS.addLeds<P9813>(leds, NUM_LEDS);
- //CLEDController *pLed = new ClocklessController_Trinket<4, NS(400), NS(400), NS(450), GRB>();
- //LEDS.addLeds(pLed, leds, NUM_LEDS);
- // LEDS.addLeds<LPD8806>(leds, NUM_LEDS);
- // LEDS.addLeds<WS2801>(leds, NUM_LEDS);
- // LEDS.addLeds<SM16716>(leds, NUM_LEDS);
- // LEDS.addLeds<WS2811, 11>(leds, NUM_LEDS);
- // Put ws2801 strip on the hardware SPI pins with a BGR ordering of rgb and limited to a 1Mhz data rate
- // LEDS.addLeds<WS2801, 11, 13, BGR, DATA_RATE_MHZ(1)>(leds, NUM_LEDS);
- // LEDS.addLeds<LPD8806, 10, 11>(leds, NUM_LEDS);
- // LEDS.addLeds<WS2811, 13, BRG>(leds, NUM_LEDS);
- // LEDS.addLeds<LPD8806, BGR>(leds, NUM_LEDS);
- }
- void loop() {
- for (int i=0;i<256;i++){
- for (int j=0; j< numLeds; j++){
- leds [j] = yourcolor.nscale8_video(i);
- }
- }
- for (int i=255;i>=0;i--){
- for (int j=0; j< numLeds; j++){
- leds [j] = yourcolor.nscale8_video(i);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment