Skip to content

Instantly share code, notes, and snippets.

@focalintent
Created April 28, 2016 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save focalintent/d459ef7e0bf4ce67c75428d42799e9b8 to your computer and use it in GitHub Desktop.
Save focalintent/d459ef7e0bf4ce67c75428d42799e9b8 to your computer and use it in GitHub Desktop.
#include <FastLED.h>
struct PT { uint8_t x, y;};
#define NUM_LEDS 20
CRGB leds[NUM_LEDS];
PT xy[] = { {5,0}, {6,1}, {7,2}, {8,3}, {9,4}, {10,5}, {9,6}, {8,7}, {7,8}, {6,9}, {5,10}, {4,9}, {3,8}, {2,7}, {1,6}, {0,5}, {1,4}, {2,3}, {3,2}, {4,1} };
void setup() {
// ...
}
void loop() {
static uint8_t hue=0;
for(int i = 0; i < NUM_LEDS; i++) {
leds[i] = CHSV(hue, 192, inoise8_raw(xy[i].x << 8, xy[i].y << 8, millis()));
}
hue++;
FastLED.delay(1000/30);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment