#include #define PIN_LED 6 #define NUMPIXELS 30 #define PIN_TOUCH 2 Adafruit_NeoPixel pixels(NUMPIXELS, PIN_LED, NEO_GRB + NEO_KHZ800); int mode = 0; // 0 = éteint, 1 = blanc, 2 = bleu, 3 = rose... void setup() { pixels.begin(); pinMode(PIN_TOUCH, INPUT); } void loop() { if (digitalRead(PIN_TOUCH) == HIGH) { mode = (mode + 1) % 4; delay(300); // anti-rebond } switch(mode) { case 0: setColor(0, 0, 0); break; // éteint case 1: setColor(255, 220, 180); break; // blanc chaud case 2: setColor(0, 100, 255); break; // bleu case 3: setColor(255, 50, 100); break; // rose } } void setColor(byte r, byte g, byte b) { for(int i=0; i