From 562d22e29ea18e6ce2901f68d283d4d63590a78b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B8vbr=C3=B8tte=20Olsen?= Date: Mon, 3 Apr 2017 13:28:01 +0200 Subject: [PATCH] Create chaos --- School/vg2/borg/demos/chaos | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 School/vg2/borg/demos/chaos diff --git a/School/vg2/borg/demos/chaos b/School/vg2/borg/demos/chaos new file mode 100644 index 0000000..db4bc1f --- /dev/null +++ b/School/vg2/borg/demos/chaos @@ -0,0 +1,21 @@ +#include +#include + +#define NUM_LEDS 54 +#define DATA_PIN 7 + +CRGB leds[NUM_LEDS]; + +void setup() +{ + FastLED.addLeds(leds, NUM_LEDS); + + randomSeed(analogRead(0)); +} + +void loop() +{ + int select = random(0, NUM_LEDS); + leds[select] = (CRGB) random(1, 0x1000000); + FastLED.show(); +}