Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // blur
- //
- // By: James Caruthers
- // Modified by: Andrew Tuline
- //
- // Date: Aug, 2014
- //
- #include <FastLED.h> // FastLED library
- #define LED_DT 12 // Data pin
- #define LED_CK 11
- #define NUM_LEDS 24 // Number of LED's
- #define COLOR_ORDER BGR // Change the order as necessary
- #define LED_TYPE APA102 // What kind of strip are you using?
- #define BRIGHTNESS 64 // How bright do we want to go
- struct CRGB leds[NUM_LEDS]; // Initializxe our array
- struct CRGB temp[NUM_LEDS]; // Initializxe our array
- int thisdelay = 20; // A delay value for the sequence(s)
- void setup() {
- Serial.begin(57600);
- LEDS.addLeds<LED_TYPE, LED_DT, LED_CK, COLOR_ORDER>(leds, NUM_LEDS);
- FastLED.setBrightness(BRIGHTNESS);
- } // setup()
- void loop () {
- blur();
- LEDS.show(); // FastLED display
- delay(thisdelay); // Standard delay
- } // loop()
- void blur() {
- for(int b = 0; b < 16; b++) {
- for(int x = 0; x < NUM_LEDS; x++) {
- temp[x] = leds[x] + (leds[(((x-1)%NUM_LEDS)+NUM_LEDS)%NUM_LEDS]%10) + (leds[(x+1)%NUM_LEDS]%10);
- }
- memcpy8(leds, temp, sizeof(leds));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement