#define FASTLED_ALLOW_INTERRUPTS 0
#include "button.h"
#include <FastLED.h>
#define LED_STRIP 6
#define LED_RINGS 7
#define NUM_LEDS_S 36
#define NUM_LEDS_R 72
//#define NUM_BUTTONS 6
//Button btn[NUM_BUTTONS] = {33, 35, 37, 39, 41, 43};
//int buttonPins[NUM_BUTTONS] = {33, 35, 37, 39, 41, 43};
Button btn1;
Button btn2;
Button btn3;
Button btn4;
Button btn5;
Button btn6;
Button btn7;
Button btn8;
Button btn9;
Button btn10;
Button btn11;
Button btn12;
Button btn13;
Button btn14;
Button btn15;
CRGBArray<NUM_LEDS_S> ledsStrip;
CRGBArray<NUM_LEDS_R> ledsRings;
void ringFade() {
static uint8_t hue;
for(int i = 0; i < NUM_LEDS_R/2; i++) {
ledsRings.fadeToBlackBy(40); //// fade everything out
ledsRings[i] = CHSV(hue++,255,255); // let's set an led value
// now, let's first 20 leds to the top 20 leds,
ledsRings(NUM_LEDS_R/2,NUM_LEDS_R-1) = ledsRings(NUM_LEDS_R/2 - 1 ,0);
FastLED.delay(33);
}}
void setup() {
Serial.begin(9600);
btn1.begin(33);
btn2.begin(35);
btn3.begin(37);
btn4.begin(39);
btn5.begin(41);
btn6.begin(43);//setup the bounce instance for the current button
FastLED.addLeds<NEOPIXEL,LED_STRIP>(ledsStrip, NUM_LEDS_S);
FastLED.addLeds<NEOPIXEL,LED_RINGS>(ledsRings, NUM_LEDS_R);
FastLED.clear(); // clear all pixel data
FastLED.show();
}
void loop(){
ringFade();
FastLED.show();
if (btn1.debounce() ) {
ledsStrip(0, 6) = CRGB::Amethyst;
FastLED.show(); delay(100);
Serial.println("button1");}
if (btn2.debounce() ) {
ledsStrip(7, 10) = CRGB(255, 255, 0);
FastLED.show(); delay(100);
Serial.println("button2");}
if (btn3.debounce() ) {
ledsStrip(11, 16) = CRGB(255, 0, 0);
FastLED.show(); delay(100);
Serial.println("button3");}
if (btn4.debounce() ) {
ledsStrip(18, 23) = CRGB(0, 255, 255);
FastLED.show(); delay(100);
Serial.println("button4");}
if (btn5.debounce() ) {
ledsStrip(25, 30) = CRGB(0, 0, 255);
FastLED.show(); delay(100);
Serial.println("button5");}
if (btn6.debounce() ) {
ledsStrip(31, 36) = CRGB(255, 255, 255);
FastLED.show(); delay(100);
Serial.println("button6");}
else {
ledsStrip(0, 36) = CRGB(0, 0, 0);
FastLED.show(); delay(10);
}}
// else {
// FastLED.clear();}
//}