From 86e24f8f7acdc3369664979926c326b2911959e6 Mon Sep 17 00:00:00 2001 From: George Griffin Date: Sat, 3 Oct 2015 23:51:02 -0400 Subject: [PATCH] refactors threeDee and exposes a new lensMask --- effects.h | 10 +++------- utils.h | 8 ++++++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/effects.h b/effects.h index 830209f..c2d6a52 100644 --- a/effects.h +++ b/effects.h @@ -173,18 +173,14 @@ void threeDee() { for (byte x = 0; x < kMatrixWidth; x++) { for (byte y = 0; y < kMatrixHeight; y++) { - if (x < 7) { + if (x <= 7) { leds[XY(x, y)] = CRGB::Blue; - } else if (x > 8) { + } else if (x >= 8) { leds[XY(x, y)] = CRGB::Red; - } else { - leds[XY(x, y)] = CRGB::Black; } } } - - leds[XY(6, 0)] = CRGB::Black; - leds[XY(9, 0)] = CRGB::Black; + lensMask(); } diff --git a/utils.h b/utils.h index 3d385b4..0c1c66f 100644 --- a/utils.h +++ b/utils.h @@ -117,6 +117,14 @@ void confirmBlink() { } +void lensMask(){ + const int mask_leds[] = {5,6,7,8,21,22}; // The individual LEDs that make up the "nosebridge" + for(int i=0; i