Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int HALF_POS = (NUM_LEDS * 0.5) - 1;
- void radiate() {
- zero = mono[0];
- three = mono[4];
- six = mono[6];
- leds[HALF_POS] = CRGB(zero, three, six);
- // high frequencies = blue = FAST SPEED
- EVERY_N_MILLISECONDS(11) {
- for (int i = NUM_LEDS; i > HALF_POS; i--) {
- leds[i].blue = leds[i - 1].blue;
- }
- }
- // mid frequencies = green = MEDIUM SPEED
- EVERY_N_MILLISECONDS(30) {
- for (int i = NUM_LEDS; i > HALF_POS; i--) {
- leds[i].green = leds[i - 1].green;
- }
- }
- // low frequencies = red = SLOW SPEED
- EVERY_N_MILLISECONDS(58) {
- for (int i = NUM_LEDS; i > HALF_POS; i--) {
- leds[i].red = leds[i - 1].red;
- }
- }
- // for mirroring to the other half of the strip
- for (int i = NUM_LEDS; i > HALF_POS; i--) {
- leds[HALF_POS - (i - HALF_POS)] = leds[i - 1];
- }
- FastLED.show();
- }
Advertisement
Add Comment
Please, Sign In to add comment