#include "FastLED.h"
#include "RTClib.h" // https://github.com/adafruit/RTClib
RTC_DS3231 rtc;
const int NUM_LEDS = 256;
const int DATA_PIN = 6;
const int photoPin = A0; // Entrée analogique avec photorésistance
CRGB leds[NUM_LEDS];
#define hplus 2 // pour incrémenter l'heure
#define mplus 3 // pour l'incrémentation de la minute
#define colorjour CRGB::Fuchsia
#define colormois CRGB::Gold
#define colorheure CRGB::Red
#define colorminute CRGB::Blue
byte ora, minut;
unsigned long tpschimbare;
unsigned long tpsecunda = 1000;
int x1; // tens of hour
int y1; // units of hour
int z1; // tens of minute
int w1; // units of minute
int g1 ; // mois
int w10 = 60;
int contor = 0;
int contor0 = 60;
/*
long ColorTable[16] = {
CRGB::Amethyst,
CRGB::Aqua,
CRGB::Blue,
CRGB::Chartreuse,
CRGB::DarkGreen,
CRGB::DarkMagenta,
CRGB::DarkOrange,
CRGB::DeepPink,
CRGB::Fuchsia,
CRGB::Gold,
CRGB::GreenYellow,
CRGB::LightCoral,
CRGB::Tomato,
CRGB::Salmon,
CRGB::Red,
CRGB::Orchid
};
*/
//////////////////////////////
// SETUP
/////////////////////////////
void setup() {
Serial.begin(115200);
pinMode(hplus, INPUT_PULLUP);
pinMode(mplus, INPUT_PULLUP);
digitalWrite (hplus, HIGH);
digitalWrite (mplus, HIGH);
// rtc.begin();
if (! rtc.begin())
{
Serial.println("Couldn't find RTC");
Serial.flush();
while (1) delay(10);
}
if (rtc.lostPower()) {
Serial.println("RTC lost power, let's set the time!");
// Lorsqu'il faut régler l'heure sur un nouvel appareil, ou après une coupure de courant, la touche
// ligne suivante règle le RTC sur la date et l'heure à laquelle ce sketch a été compilé.
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
// Cette ligne règle le RTC avec une date et une heure explicites, par exemple pour régler le mois de janvier 2014 à 3 heures du matin, vous devez appeler :
// 21 janvier 2014 à 3 heures du matin, vous devez appeler :
// rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0)) ;
}
//Lorsque l'heure doit être remise à zéro sur un appareil déjà configuré, la ligne
// ligne suivante règle le RTC à la date et à l'heure où cette esquisse a été compilée
// rtc.adjust(DateTime(F(__DATE__), F(__TIME__))) ;
// Cette ligne règle le RTC avec une date et une heure explicites, par exemple pour régler
// 21 janvier 2014 à 3h du matin, vous devriez appeler :
// rtc.adjust(DateTime(2025, 07, 03, 9, 13, 0)) ; // <<===============================
delay(2000);
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(2); //Number 0-255
FastLED.clear();
// lire l'heure
DateTime now = rtc.now();
int x1 = now.hour()/10; // dizaines d'heures
int y1 = now.hour()%10; // unité d'heure
int z1 = now.minute()/10; // dizaines de minutes
int w1 = now.minute()%10; // unité de minute
FastLED.clear();
afisare_ora(x1, y1, z1, w1);
contor = 0;
}
// Affichage des Leds /////////////////////////////////
// dizaine heure
const uint16_t h_d_0[] PROGMEM = {237,236,235,234,233,215,214,213,212,211,210,209,206,200,183,177,174,173,172,171,170,169,168,150,149,148,147,146};
const uint16_t h_d_1[] PROGMEM = {215,210,206,205,204,203,202,201,200,183,182,181,180,179,178,177,168};
const uint16_t h_d_2[] PROGMEM = {237,233,232,215,214,213,210,209,206,203,202,200,183,180,177,174,173,172,171,168,151,147,146};
// unite Heure
const uint16_t h_e_0[] PROGMEM = {18,19,20,21,22,40,41,42,43,44,45,46,49,55,72,78,81,82,83,84,85,86,87,105,106,107,108,109};
const uint16_t h_e_1[] PROGMEM = {40,49,50,51,52,53,54,55,72,73,74,75,76,77,78,82,87};
const uint16_t h_e_2[] PROGMEM = {18,19,23,40,43,44,45,46,49,52,55,72,74,75,78,81,82,85,86,87,104,105,109};
const uint16_t h_e_3[] PROGMEM = {18,19,21,22,40,41,42,43,44,45,46,49,52,55,72,75,78,81,82,86,87,105,109};
const uint16_t h_e_4[] PROGMEM = {17,18,19,20,21,22,23,40,41,42,43,44,45,46,52,75,81,82,83,84,107,108};
const uint16_t h_e_5[] PROGMEM = {17,21,22,40,41,42,43,46,49,52,55,72,75,78,81,82,83,84,86,87,105,107,108,109,110};
const uint16_t h_e_6[] PROGMEM = {18,21,22,40,41,42,43,45,46,49,52,55,72,75,78,81,82,83,84,85,86,87,105,106,107,108,109};
const uint16_t h_e_7[] PROGMEM = {17,18,19,43,44,45,46,49,52,53,54,55,72,73,74,78,81,82,109,110};
const uint16_t h_e_8[] PROGMEM = {18,19,21,22,40,41,42,43,44,45,46,49,52,55,72,75,78,81,82,83,84,85,86,87,105,106,108,109};
const uint16_t h_e_9[] PROGMEM = {18,19,20,21,22,40,41,42,43,44,45,46,49,52,55,72,75,78,81,82,83,84,86,87,105,108,109};
// dizaine minute
const uint16_t m_d_0[] PROGMEM = {153,154,155,156,157,161,162,163,164,165,166,167,184,190,193,199,216,217,218,219,220,221,222,226,227,228,229,230};
const uint16_t m_d_1[] PROGMEM = {161,184,185,186,187,188,189,190,193,194,195,196,197,198,199,217,222};
const uint16_t m_d_2[] PROGMEM = {153,154,158,161,164,165,166,167,184,187,190,193,195,196,199,216,220,221,222,225,226,230};
const uint16_t m_d_3[] PROGMEM = {153,154,156,157,161,162,163,164,165,166,167,184,187,190,193,196,199,216,221,222,226,230};
const uint16_t m_d_4[] PROGMEM = {152,153,154,155,156,157,158,161,162,163,164,165,166,167,187,196,216,217,218,219,228,229};
const uint16_t m_d_5[] PROGMEM = {152,156,157,161,162,163,164,167,184,187,190,193,196,199,216,217,218,219,221,222,226,228,229,230,231};
// unite minute
const uint16_t m_e_0[] PROGMEM = {25,26,27,28,29,33,34,35,36,37,38,39,56,62,65,71,88,89,90,91,92,93,94,98,99,100,101,102};
const uint16_t m_e_1[] PROGMEM = {33,56,57,58,59,60,61,62,65,66,67,68,69,70,71,89,94};
const uint16_t m_e_2[] PROGMEM = {25,26,30,33,36,37,38,39,56,59,62,65,67,68,71,88,92,93,94,97,98,102};
const uint16_t m_e_3[] PROGMEM = {25,26,28,29,33,34,35,36,37,38,39,56,59,62,65,68,71,88,94,98,102};
const uint16_t m_e_4[] PROGMEM = {24,25,26,27,28,29,30,33,34,35,36,37,38,39,59,68,88,89,90,91,100,101};
const uint16_t m_e_5[] PROGMEM = {24,28,29,33,34,35,36,39,56,59,62,65,68,71,88,89,90,91,93,94,98,100,101,102,103};
const uint16_t m_e_6[] PROGMEM = {25,28,29,33,34,35,36,39,56,59,62,65,68,71,88,89,90,91,92,93,94,98,99,100,101,102};
const uint16_t m_e_7[] PROGMEM = {24,25,26,36,37,38,39,56,59,60,61,62,65,66,67,71,88,89,102,103};
const uint16_t m_e_8[] PROGMEM = {25,26,28,29,33,34,35,36,37,38,39,56,59,62,65,68,71,88,89,90,91,92,93,94,98,99,101,102};
const uint16_t m_e_9[] PROGMEM = {25,26,27,28,29,33,34,35,36,37,38,39,56,59,62,65,68,71,88,89,90,91,93,94,98,101,102};
// seconde
const uint16_t sec_0[] PROGMEM = {112,111,80,79,48,47,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,31,32,63,64,95,96,127,
128,159,160,191,192,223,224,255,254,253,252,251,250,249,248,247,246,245,244,243,242,241,
240,239,208,207,176,175,144,143};
////// JOUR /////////////////
// dizaine jour
const uint16_t j_d_0[] PROGMEM = {209,210,211,212,213,214,201,182,181,180,179,178,177,206};
const uint16_t j_d_1[] PROGMEM = {210,214,206,205,204,203,202,201,182};
const uint16_t j_d_2[] PROGMEM = {210,206,178,179,203,213,214,201,182};
const uint16_t j_d_3[] PROGMEM = {209,206,177,178,204,179,203,180,181,182,201,214};
// unite jour
const uint16_t j_u_0[] PROGMEM = {145,142,113,114,115,116,117,118,137,150,149,148,147,146};
const uint16_t j_u_1[] PROGMEM = {146,142,141,140,139,138,137,150,118};
const uint16_t j_u_2[] PROGMEM = {146,142,114,115,139,149,150,137,118};
const uint16_t j_u_3[] PROGMEM = {145,142,113,114,140,115,139,116,117,150,137,118};
const uint16_t j_u_4[] PROGMEM = {145,146,147,148,139,114,115,116,117,118};
const uint16_t j_u_5[] PROGMEM = {113,142,145,146,147,140,115,116,117,118,137,150};
const uint16_t j_u_6[] PROGMEM = {113,142,145,146,147,148,149,140,115,116,117,118,137,150};
const uint16_t j_u_7[] PROGMEM = {145,142,113,114,115,116,117,118};
const uint16_t j_u_8[] PROGMEM = {145,142,113,114,115,116,117,118,137,150,149,148,147,146,140,139};
const uint16_t j_u_9[] PROGMEM = {145,142,113,114,115,116,117,118,137,150,147,146,140};
//// MOIS en 3 lettres /////////////////
//JAN
const uint16_t m_l1_1[] PROGMEM = {220,221,194,189,188,187,186,185,184};
const uint16_t m_l2_1[] PROGMEM = {157,156,155,154,153,152,135,120,121,122,123,124,125,133};
const uint16_t m_l3_1[] PROGMEM = {93,92,91,90,89,88,71,56,57,58,59,60,61};
//FEV
const uint16_t m_l1_2[] PROGMEM = {216,199,184,217,218,219,220,221,196};
const uint16_t m_l2_2[] PROGMEM = {152,135,120,153,154,155,156,157,130,125,132};
const uint16_t m_l3_2[] PROGMEM = {88,89,90,91,92,66,60,59,58,57,56};
//MAR
const uint16_t m_l1_3[] PROGMEM = {216,198,185,167,217,218,219,220,221,166,165,164,163,162};
const uint16_t m_l2_3[] PROGMEM = {135,120,103,134,133,132,131,130,102,101,100,99,98,123};
const uint16_t m_l3_3[] PROGMEM = {66,67,68,69,70,71,56,39,38,37,58,59,35,34};
//AVR
const uint16_t m_l1_4[] PROGMEM = {221,220,219,218,217,216,199,184,185,186,187,188,189,197};
const uint16_t m_l2_4[] PROGMEM = {152,153,154,155,156,130,124,123,122,121,120};
const uint16_t m_l3_4[] PROGMEM = {88,89,90,91,92,93,71,56,57,58,69,68,60,61};
//MAI
const uint16_t m_l1_5[] PROGMEM = {216,198,185,167,217,218,219,220,221,166,165,164,163,162};
const uint16_t m_l2_5[] PROGMEM = {135,120,103,134,133,132,131,130,102,101,100,99,98,123};
const uint16_t m_l3_5[] PROGMEM = {56,57,58,59,60,61};
//JUN
const uint16_t m_l1_6[] PROGMEM = {220,221,194,189,188,187,186,185,184};
const uint16_t m_l2_6[] PROGMEM = {152,153,154,155,156,157,130,125,124,123,122,121,120};
const uint16_t m_l3_6[] PROGMEM = {93,92,91,90,89,88,71,56,57,58,59,60,61};
//JUL
const uint16_t m_l1_7[] PROGMEM = {220,221,194,189,188,187,186,185,184};
const uint16_t m_l2_7[] PROGMEM = {152,153,154,155,156,157,130,125,124,123,122,121,120};
const uint16_t m_l3_7[] PROGMEM = {88,89,90,91,92,93,66,61};
//AOU
const uint16_t m_l1_8[] PROGMEM = {221,220,219,218,217,216,199,184,185,186,187,188,189,197};
const uint16_t m_l2_8[] PROGMEM = {157,156,155,154,153,152,135,120,121,122,123,124,125,130};
const uint16_t m_l3_8[] PROGMEM = {88,89,90,91,92,93,66,61,60,59,58,57,56};
//SEP
const uint16_t m_l1_9[] PROGMEM = {221,194,189,188,187,186,197,218,217,216,199,184};
const uint16_t m_l2_9[] PROGMEM = {125,130,157,156,155,154,153,152,135,120,133,122};
const uint16_t m_l3_9[] PROGMEM = {93,92,91,90,89,88,71,56,57,58,69};
//OCT
const uint16_t m_l1_10[] PROGMEM = {189,194,221,220,219,218,217,216,199,184,185,186,187,188};
const uint16_t m_l2_10[] PROGMEM = {125,130,157,156,155,154,153,152,135,120};
const uint16_t m_l3_10[] PROGMEM = {88,71,56,70,69,68,67,66};
//NOV
const uint16_t m_l1_11[] PROGMEM = {221,220,219,218,217,216,199,184,185,186,187,188,189};
const uint16_t m_l2_11[] PROGMEM = {157,156,155,154,153,152,135,120,121,122,123,124,125,130};
const uint16_t m_l3_11[] PROGMEM = {88,89,90,91,92,66,60,59,58,57,56};
//DEC
const uint16_t m_l1_12[] PROGMEM = {194,221,220,219,218,217,216,199,185,186,187,188};
const uint16_t m_l2_12[] PROGMEM = {125,130,157,156,155,154,153,152,135,120,133,122};
const uint16_t m_l3_12[] PROGMEM = {61,66,93,92,91,90,89,88,71,56};
//////////////////////////////
// LOOP
/////////////////////////////
void loop() {
// reglage luminosite
/*
// Serial.println(analogRead(photoPin)) ;
if(analogRead(photoPin) < 270) FastLED.setBrightness(15) ;
else if(analogRead(photoPin) < 470) FastLED.setBrightness(10) ;
else if(analogRead(photoPin) < 700)FastLED.setBrightness(5) ;
else FastLED.setBrightness(2) ;
*/
FastLED.setBrightness(255) ; // test Wokwi
// Lire la date et l'heure
DateTime now = rtc.now();
int x1 = now.hour()/10; // tens of hour
int y1 = now.hour()%10; // units of hour
int z1 = now.minute()/10; // tens of minute
int w1 = now.minute()%10; // units of minute
/*
Serial.println(now.year()-2000, DEC);
int annee = now.year()-2000;
int a1 = annee/10; //dizaine Année
int b1 = annee%10; //unitee Année
*/
//Serial.println(now.month(), DEC);
int g1 = now.month();
//int c1 = now.month()/10; //dizaine mois
//int d1 = now.month()%10; //unite mois
//Serial.println(now.day(), DEC);
int e1 = 0;
e1 = now.day()/10; //dizaine jour
int f1 = 0;
f1 = now.day()%10; //unite jour
minut = 10*z1+w1;
ora = 10*x1+y1;
citirebutoane();
if (contor != contor0)
{
if (contor >= 1) leds[pgm_read_byte(&sec_0[contor-1])] = CRGB(0,0,0);
leds[pgm_read_byte(&sec_0[contor])] = CRGB(0, 255, 0);
FastLED.show();
}
contor0 = contor;
if (millis() - tpschimbare > tpsecunda)
{
contor++;
if (contor > sizeof(sec_0) / sizeof(int *)-1)
{
FastLED.clear();
afisare_ora(x1, y1, z1, w1);
contor = 0;
}
if (contor == 30 ) { // <======
FastLED.clear();
affiche_date(g1, e1, f1);
}
if (contor ==32 ) {
FastLED.clear();
afisare_ora(x1, y1, z1, w1);
}
tpschimbare = millis();
}
delay(50);
} // end main loop
//////////////////////////////////////////////
void citirebutoane() {
if (digitalRead(hplus) == LOW)
{
Serial.print(ora);
Serial.print("-> ");
ora = ora + 1;
if (ora > 23) ora = 0;
Serial.println(ora);
//rtc.setTime(ora, minut, 0);
rtc.adjust(DateTime(2023, 1, 21, ora, minut, 0));
Serial.println("H+");
delay(500);
FastLED.clear();
afisare_ora(ora/10, ora%10, minut/10, minut%10);
contor = 0;
contor0 = 60;
}
if (digitalRead(mplus) == LOW)
{
Serial.print(minut);
Serial.print("-> ");
minut = minut + 1;
if (minut > 59) minut = 0;
Serial.println(minut);
//rtc.setTime(ora, minut, 0);
rtc.adjust(DateTime(2023, 1, 21, ora, minut, 0));
Serial.println("M+");
delay(500);
FastLED.clear();
afisare_ora(ora/10, ora%10, minut/10, minut%10);
contor = 0;
contor0 = 60;
}
}
//////////////////////////////////////////////
void afisare_ora(int x, int y, int z, int w) {
//dizaine heure
if(x==0){
/*
for (int i = 0; i <=sizeof(h_d_0) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&h_d_0[i])] = colorheure;
}
FastLED.show();
*/
}
else if(x==1){
for (int i = 0; i <=sizeof(h_d_1) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&h_d_1[i])] = colorheure;
}
FastLED.show();
}
else if(x==2){
for (int i = 0; i <=sizeof(h_d_2) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&h_d_2[i])] = colorheure;
}
FastLED.show();
}
//unitee heure
if(y==0){
for (int i = 0; i <=sizeof(h_e_0) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&h_e_0[i])] = colorheure;
}
FastLED.show();
}
else if(y==1){
for (int i = 0; i <=sizeof(h_e_1) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&h_e_1[i])] = colorheure;
}
FastLED.show();
}
else if(y==2){
for (int i = 0; i <=sizeof(h_e_2) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&h_e_2[i])] = colorheure;
}
FastLED.show();
}
else if(y==3){
for (int i = 0; i <=sizeof(h_e_3) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&h_e_3[i])] = colorheure;
}
FastLED.show();
}
else if(y==4){
for (int i = 0; i <=sizeof(h_e_4) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&h_e_4[i])] = colorheure;
}
FastLED.show();
}
else if(y==5){
for (int i = 0; i <=sizeof(h_e_5) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&h_e_5[i])] = colorheure;
}
FastLED.show();
}
else if(y==6){
for (int i = 0; i <=sizeof(h_e_6) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&h_e_6[i])] = colorheure;
}
FastLED.show();
}
else if(y==7){
for (int i = 0; i <=sizeof(h_e_7) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&h_e_7[i])] = colorheure;
}
FastLED.show();
}
else if(y==8){
for (int i = 0; i <=sizeof(h_e_8) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&h_e_8[i])] = colorheure;
}
FastLED.show();
}
else if(y==9){
for (int i = 0; i <=sizeof(h_e_9) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&h_e_9[i])] = colorheure;
}
FastLED.show();
}
//dizaine minute
if(z==0){
for (int i = 0; i <=sizeof(m_d_0) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_d_0[i])] = colorminute;
}
FastLED.show();
}
else if(z==1){
for (int i = 0; i <=sizeof(m_d_1) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_d_1[i])] = colorminute;
}
FastLED.show();
}
else if(z==2){
for (int i = 0; i <=sizeof(m_d_2) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_d_2[i])] = colorminute;
}
FastLED.show();
}
else if(z==3){
for (int i = 0; i <=sizeof(m_d_3) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_d_3[i])] = colorminute;
}
FastLED.show();
}
else if(z==4){
for (int i = 0; i <=sizeof(m_d_4) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_d_4[i])] = colorminute;
}
FastLED.show();
}
else if(z==5){
for (int i = 0; i <=sizeof(m_d_5) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_d_5[i])] = colorminute;
}
FastLED.show();
}
//unite minute
if(w==0){
for (int i = 0; i <=sizeof(m_e_0) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_e_0[i])] = colorminute;
}
FastLED.show();
}
else if(w==1){
for (int i = 0; i <=sizeof(m_e_1) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_e_1[i])] = colorminute;
}
FastLED.show();
}
else if(w==2){
for (int i = 0; i <=sizeof(m_e_2) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_e_2[i])] = colorminute;
}
FastLED.show();
}
else if(w==3){
for (int i = 0; i <=sizeof(m_e_3) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_e_3[i])] = colorminute;
}
FastLED.show();
}
else if(w==4){
for (int i = 0; i <=sizeof(m_e_4) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_e_4[i])] = colorminute;
}
FastLED.show();
}
else if(w==5){
for (int i = 0; i <=sizeof(m_e_5) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_e_5[i])] = colorminute;
}
FastLED.show();
}
else if(w==6){
for (int i = 0; i <=sizeof(m_e_6) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_e_6[i])] = colorminute;
}
FastLED.show();
}
else if(w==7){
for (int i = 0; i <=sizeof(m_e_7) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_e_7[i])] = colorminute;
}
FastLED.show();
}
else if(w==8){
for (int i = 0; i <=sizeof(m_e_8) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_e_8[i])] = colorminute;
}
FastLED.show();
}
else if(w==9){
for (int i = 0; i <=sizeof(m_e_9) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_e_9[i])] = colorminute;
}
FastLED.show();
}
}
void affiche_date(int g, int e, int f) {
//dizaine jour
if(e==0){
for (int i = 0; i <=sizeof(j_d_0) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&j_d_0[i])] = colorjour;
}
FastLED.show();
}
else if(e==1){
for (int i = 0; i <=sizeof(j_d_1) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&j_d_1[i])] = colorjour;
}
FastLED.show();
}
else if(e==2){
for (int i = 0; i <=sizeof(j_d_2) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&j_d_2[i])] = colorjour;
}
FastLED.show();
}
else if(e==3){
for (int i = 0; i <=sizeof(j_d_3) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&j_d_3[i])] = colorjour;
}
FastLED.show();
}
//unite jour
if(f==0){
for (int i = 0; i <=sizeof(j_u_0) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&j_u_0[i])] = colorjour;
}
FastLED.show();
}
else if(f==1){
for (int i = 0; i <=sizeof(j_u_1) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&j_u_1[i])] = colorjour;
}
FastLED.show();
}
else if(f==2){
for (int i = 0; i <=sizeof(j_u_2) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&j_u_2[i])] = colorjour;
}
FastLED.show();
}
else if(f==3){
for (int i = 0; i <=sizeof(j_u_3) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&j_u_3[i])] = colorjour;
}
FastLED.show();
}
else if(f==4){
for (int i = 0; i <=sizeof(j_u_4) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&j_u_4[i])] = colorjour;
}
FastLED.show();
}
else if(f==5){
for (int i = 0; i <=sizeof(j_u_5) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&j_u_5[i])] = colorjour;
}
FastLED.show();
}
else if(f==6){
for (int i = 0; i <=sizeof(j_u_6) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&j_u_6[i])] = colorjour;
}
FastLED.show();
}
else if(f==7){
for (int i = 0; i <=sizeof(j_u_7) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&j_u_7[i])] = colorjour;
}
FastLED.show();
}
else if(f==8){
for (int i = 0; i <=sizeof(j_u_8) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&j_u_8[i])] = colorjour;
}
FastLED.show();
}
else if(f==9){
for (int i = 0; i <=sizeof(j_u_9) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&j_u_9[i])] = colorjour;
}
FastLED.show();
}
// mois 3 lettres
// lettre N°1
if(g==1){
for (int i = 0; i <=sizeof(m_l1_1) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l1_1[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l2_1) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l2_1[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l3_1) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l3_1[i])] = colormois;
}
FastLED.show();
}
else if(g==2){
for (int i = 0; i <=sizeof(m_l1_2) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l1_2[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l2_2) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l2_2[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l3_2) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l3_2[i])] = colormois;
}
FastLED.show();
}
else if(g==3){
for (int i = 0; i <=sizeof(m_l1_3) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l1_3[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l2_3) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l2_3[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l3_3) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l3_3[i])] = colormois;
}
FastLED.show();
}
else if(g==4){
for (int i = 0; i <=sizeof(m_l1_4) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l1_4[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l2_4) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l2_4[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l3_4) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l3_4[i])] = colormois;
}
FastLED.show();
}
else if(g==5){
for (int i = 0; i <=sizeof(m_l1_5) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l1_5[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l2_5) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l2_5[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l3_5) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l3_5[i])] = colormois;
}
FastLED.show();
}
else if(g==6){
for (int i = 0; i <=sizeof(m_l1_6) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l1_6[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l2_6) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l2_6[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l3_6) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l3_6[i])] = colormois;
}
FastLED.show();
}
else if(g==7){
for (int i = 0; i <=sizeof(m_l1_7) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l1_7[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l2_7) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l2_7[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l3_7) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l3_7[i])] = colormois;
}
FastLED.show();
}
else if(g==8){
for (int i = 0; i <=sizeof(m_l1_8) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l1_8[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l2_8) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l2_8[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l3_8) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l3_8[i])] = colormois;
}
FastLED.show();
}
else if(g==9){
for (int i = 0; i <=sizeof(m_l1_9) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l1_9[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l2_9) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l2_9[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l3_9) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l3_9[i])] = colormois;
}
FastLED.show();
}
else if(g==10){
for (int i = 0; i <=sizeof(m_l1_10) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l1_10[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l2_10) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l2_10[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l3_10) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l3_10[i])] = colormois;
}
FastLED.show();
}
else if(g==11){
for (int i = 0; i <=sizeof(m_l1_11) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l1_11[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l2_11) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l2_11[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l3_11) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l3_11[i])] = colormois;
}
FastLED.show();
}
else if(g==12){
for (int i = 0; i <=sizeof(m_l1_12) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l1_12[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l2_12) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l2_12[i])] = colormois;
}
FastLED.show();
for (int i = 0; i <=sizeof(m_l3_12) / sizeof(int *)-1; i++){
leds[pgm_read_byte(&m_l3_12[i])] = colormois;
}
FastLED.show();
}
}