Voila le programme final, une tuerie je vais poster une photo et j'espère une vidéo avec mon téléphone.
// Appel de la librairie Adafruit NeoPixel
#include <Adafruit_NeoPixel.h>
//Initialisation de la bande led utilisée avec son nombre et la sortie.
Adafruit_NeoPixel ArcReactorMk50(12, 9, NEO_GRB + NEO_KHZ800);
uint32_t cyan = ArcReactorMk50.Color(0, 255, 255);
//Groupe de variable pour la led L0
int i0 = 0;
int debut0 = 0;
int fin0 = 255;
int increment0 = 15;
unsigned long ChronoTemp0 = 0;
unsigned long tempAttente0 = 10;
//Groupe de variable pour la led i1
int i1 = 0;
int debut1 = 0;
int fin1 = 255;
int increment1 = 15;
unsigned long ChronoTemp1 = 0;
unsigned long tempAttente1 = 5;
//Groupe de variable pour la led i2
int i2 = 0;
int debut2 = 0;
int fin2 = 255;
int increment2 = 15;
unsigned long ChronoTemp2 = 0;
unsigned long tempAttente2 = 5;
//Groupe de variable pour la led i4
int i4 = 0;
int debut4 = 0;
int fin4 = 255;
int increment4 = 15;
unsigned long ChronoTemp4 = 0;
unsigned long tempAttente4 = 5;
//Groupe de variable pour la led i5
int i5 = 0;
int debut5 = 0;
int fin5 = 255;
int increment5 = 15;
unsigned long ChronoTemp5 = 0;
unsigned long tempAttente5 = 5;
//Groupe de variable pour la led i6
int i6 = 0;
int debut6 = 0;
int fin6 = 255;
int increment6 = 15;
unsigned long ChronoTemp6 = 0;
unsigned long tempAttente6 = 5;
//Groupe de variable pour la led i8
int i8 = 0;
int debut8 = 0;
int fin8 = 255;
int increment8 = 15;
unsigned long ChronoTemp8 = 0;
unsigned long tempAttente8 = 5;
//Groupe de variable pour la led i9
int i9 = 0;
int debut9 = 0;
int fin9 = 255;
int increment9 = 15;
unsigned long ChronoTemp9 = 0;
unsigned long tempAttente9 = 5;
//Groupe de variable pour la led i10
int i10 = 0;
int debut10 = 0;
int fin10 = 255;
int increment10 = 15;
unsigned long ChronoTemp10 = 0;
unsigned long tempAttente10 = 5;
void setup() {
ArcReactorMk50.begin();
ArcReactorMk50.show();
ChronoTemp0 == millis();
ChronoTemp1 == millis();
ChronoTemp2 == millis();
ChronoTemp4 == millis();
ChronoTemp5 == millis();
ChronoTemp6 == millis();
ChronoTemp8 == millis();
ChronoTemp9 == millis();
ChronoTemp10 == millis();
// ici les leds que je voudrai garder fixent durant tous le programme.
ArcReactorMk50.setPixelColor(11, cyan);
ArcReactorMk50.setPixelColor(7, cyan);
ArcReactorMk50.setPixelColor(3, cyan);
ArcReactorMk50.show();
}
void loop() {
//Ajustement de la luminosité globale.
ArcReactorMk50.setBrightness(100);
//différents random pour faire un effet de fluctuation d'énergie.
tempAttente0 = random(5, 50);
tempAttente1 = random(10, 100);
tempAttente2 = random(15, 200);
tempAttente4 = random(6, 49);
tempAttente5 = random(11, 99);
tempAttente6 = random(16, 199);
tempAttente8 = random(7, 48);
tempAttente9 = random(12, 98);
tempAttente10 = random(17, 198);
//Lancement de la programmation de toutes les leds.
Led0();
Led1();
Led2();
Led4();
Led5();
Led6();
Led8();
Led9();
Led10();
}
//_______________________________________________________________________________________________________
void Led0() {
if (millis() - ChronoTemp0 > tempAttente0) {
ArcReactorMk50.setPixelColor(0, ArcReactorMk50.Color(0, i0, i0));
ArcReactorMk50.show();
ChronoTemp0 = millis();
i0 += increment0;
if (i0 == fin0) { // on atteint une borne, on change les paramètres
if (increment0 > 0) { // si on incrémentait
increment0 = -15;
debut0 = 255;
fin0 = 0;
} else { // si on décrémentait
increment0 = 15;
debut0 = 0;
fin0 = 255;
}
}
}
}
//_______________________________________________________________________________________________________
void Led1() {
if (millis() - ChronoTemp1 > tempAttente1) {
ArcReactorMk50.setPixelColor(1, ArcReactorMk50.Color(0, i1, i1));
ArcReactorMk50.show();
ChronoTemp1 = millis();
i1 += increment1;
if (i1 == fin1) { // on atteint une borne, on change les paramètres
if (increment1 > 0) { // si on incrémentait
increment1 = -15;
debut1 = 255;
fin1 = 0;
} else { // si on décrémentait
increment1 = 15;
debut1 = 0;
fin1 = 255;
}
}
}
}
//_______________________________________________________________________________________________________
void Led2() {
if (millis() - ChronoTemp2 > tempAttente2) {
ArcReactorMk50.setPixelColor(2, ArcReactorMk50.Color(0, i2, i2));
ArcReactorMk50.show();
ChronoTemp2 = millis();
i2 += increment2;
if (i2 == fin2) { // on atteint une borne, on change les paramètres
if (increment2 > 0) { // si on incrémentait
increment2 = -15;
debut2 = 255;
fin2 = 0;
} else { // si on décrémentait
increment2 = 15;
debut2 = 0;
fin2 = 255;
}
}
}
}
//_______________________________________________________________________________________________________
void Led4() {
if (millis() - ChronoTemp4 > tempAttente4) {
ArcReactorMk50.setPixelColor(4, ArcReactorMk50.Color(0, i4, i4));
ArcReactorMk50.show();
ChronoTemp4 = millis();
i4 += increment4;
if (i4 == fin4) { // on atteint une borne, on change les paramètres
if (increment4 > 0) { // si on incrémentait
increment4 = -15;
debut4 = 255;
fin4 = 0;
} else { // si on décrémentait
increment4 = 15;
debut4 = 0;
fin4 = 255;
}
}
}
}
//_______________________________________________________________________________________________________
void Led5() {
if (millis() - ChronoTemp5 > tempAttente5) {
ArcReactorMk50.setPixelColor(5, ArcReactorMk50.Color(0, i5, i5));
ArcReactorMk50.show();
ChronoTemp5 = millis();
i5 += increment5;
if (i5 == fin5) { // on atteint une borne, on change les paramètres
if (increment5 > 0) { // si on incrémentait
increment5 = -15;
debut5 = 255;
fin5 = 0;
} else { // si on décrémentait
increment5 = 15;
debut5 = 0;
fin5 = 255;
}
}
}
}
//_______________________________________________________________________________________________________
void Led6() {
if (millis() - ChronoTemp6 > tempAttente6) {
ArcReactorMk50.setPixelColor(6, ArcReactorMk50.Color(0, i6, i6));
ArcReactorMk50.show();
ChronoTemp6 = millis();
i6 += increment6;
if (i6 == fin6) { // on atteint une borne, on change les paramètres
if (increment6 > 0) { // si on incrémentait
increment6 = -15;
debut6 = 255;
fin6 = 0;
} else { // si on décrémentait
increment6 = 15;
debut6 = 0;
fin6 = 255;
}
}
}
}
//_______________________________________________________________________________________________________
void Led8() {
if (millis() - ChronoTemp8 > tempAttente8) {
ArcReactorMk50.setPixelColor(8, ArcReactorMk50.Color(0, i8, i8));
ArcReactorMk50.show();
ChronoTemp8 = millis();
i8 += increment8;
if (i8 == fin8) { // on atteint une borne, on change les paramètres
if (increment8 > 0) { // si on incrémentait
increment8 = -15;
debut8 = 255;
fin8 = 0;
} else { // si on décrémentait
increment8 = 15;
debut8 = 0;
fin8 = 255;
}
}
}
}
//_______________________________________________________________________________________________________
void Led9() {
if (millis() - ChronoTemp9 > tempAttente9) {
ArcReactorMk50.setPixelColor(9, ArcReactorMk50.Color(0, i9, i9));
ArcReactorMk50.show();
ChronoTemp9 = millis();
i9 += increment9;
if (i9 == fin9) { // on atteint une borne, on change les paramètres
if (increment9 > 0) { // si on incrémentait
increment9 = -15;
debut9 = 255;
fin9 = 0;
} else { // si on décrémentait
increment9 = 15;
debut9 = 0;
fin9 = 255;
}
}
}
}
//_______________________________________________________________________________________________________
void Led10() {
if (millis() - ChronoTemp10 > tempAttente10) {
ArcReactorMk50.setPixelColor(10, ArcReactorMk50.Color(0, i10, i10));
ArcReactorMk50.show();
ChronoTemp10 = millis();
i10 += increment10;
if (i10 == fin10) { // on atteint une borne, on change les paramètres
if (increment10 > 0) { // si on incrémentait
increment10 = -15;
debut10 = 255;
fin10 = 0;
} else { // si on décrémentait
increment10 = 15;
debut10 = 0;
fin10 = 255;
}
}
}
}