#include "general.h"
#include "FastLED.h"
#include "suit.h"
CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP]; // Output LEDs
Suit suit;
int hue, mode;
const bool WORKING_EXAMPLE = false;
void setup() {
Serial.begin(115200);
Serial.println("Welcome Mr. Vibes!");
Serial.println("---------------------------------");
// Initialize 4 LED strips
FastLED.addLeds<LED_TYPE, STRIP_PIN_0, COLOR_ORDER>(leds[0], NUM_LEDS_PER_STRIP)
.setCorrection(TypicalLEDStrip)
.setDither(BRIGHTNESS < 255);
FastLED.addLeds<LED_TYPE, STRIP_PIN_1, COLOR_ORDER>(leds[1], NUM_LEDS_PER_STRIP)
.setCorrection(TypicalLEDStrip)
.setDither(BRIGHTNESS < 255);
FastLED.addLeds<LED_TYPE, STRIP_PIN_2, COLOR_ORDER>(leds[2], NUM_LEDS_PER_STRIP)
.setCorrection(TypicalLEDStrip)
.setDither(BRIGHTNESS < 255);
FastLED.addLeds<LED_TYPE, STRIP_PIN_3, COLOR_ORDER>(leds[3], NUM_LEDS_PER_STRIP)
.setCorrection(TypicalLEDStrip)
.setDither(BRIGHTNESS < 255);
// Initialize the suit
suit = Suit();
hue = 0;
mode = 0;
}
void loop() {
/**
* not woring
*/
if (!WORKING_EXAMPLE) {
// Switch the mode evere X seconds
EVERY_N_SECONDS(1) {
mode++;
if (mode > 1) {
mode = 0;
}
}
// Depending on the mode, flash the LEDs
if (mode == 0) {
suit.setNeck(CRGB::Pink);
suit.setArmRight(CRGB::Black);
} else {
suit.setNeck(CRGB::Black);
suit.setArmRight(CRGB::Blue);
}
// Now assign all LEDs from the suit to the FastLED LEDs.
LED led;
for(int stripIndex = 0; stripIndex < NUM_STRIPS; stripIndex++) {
for(int ledIndex = 0; ledIndex < NUM_LEDS_PER_STRIP; ledIndex+=1) {
led = suit.led(stripIndex, ledIndex);
leds[stripIndex][ledIndex] = led.color;
}
}
}
/**
* woring fine
*/
if (WORKING_EXAMPLE){
for(int stripIndex = 0; stripIndex < NUM_STRIPS; stripIndex++) {
hue = 0;
for(int ledIndex = 0; ledIndex < NUM_LEDS_PER_STRIP; ledIndex+=1) {
leds[stripIndex][ledIndex] = CRGB(hue*4, 0, hue*2);
hue++;
}
}
}
FastLED.show();
}