#include <FastLED.h>
#define NUM_LEDS 30
#define DATA_PIN 6
CRGB LEDs[NUM_LEDS];
CRGB colorCRGB = CRGB::Red; // Change this if you want another default color, for example CRGB::Blue
CHSV colorCHSV = CHSV(95, 255, 255); // Green
CRGB colorOFF = CRGB(20,20,20); // Color of the segments that are 'disabled'. You can also set it to CRGB::Black
volatile int colorMODE = 1; // 0=CRGB, 1=CHSV, 2=Constant Color Changing pattern
volatile int mode = 0; // 0=Clock, 1=Temperature, 2=Humidity, 3=Scoreboard, 4=Time counter
void setup() {
FastLED.delay(3000);
// Check if you're LED strip is a RGB or GRB version (third parameter)
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(LEDs, NUM_LEDS);
}
void loop() {
void displayClock();
}
void displayClock() {
displaySegments(0, 1);
displaySegments(7, 2);
displaySegments(16, 3);
displaySegments(23, 4);
FastLED.show();
}
void displaySegments(int startindex, int number) {
byte numbers[] = {
0b00111111, // 0
0b00000110, // 1
0b01011011, // 2
0b01001111, // 3
0b01100110, // 4
0b01101101, // 5
0b01111101, // 6
0b00000111, // 7
0b01111111, // 8
0b01101111, // 9
0b01100011, // º 10
0b00111001, // C(elcius) 11
0b01011100, // º lower 12
0b00000000, // Empty 13
0b01110001, // F(ahrenheit) 14
};
for (int i = 0; i < 7; i++) {
LEDs[i + startindex] = ((numbers[number] & 1 << i) == 1 << i);
}
}