const int potentiometerPin = 15; // Broche analogique du potentiomètre
const int ledPin = 32; // Broche numérique de la LED
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
int potValue = analogRead(potentiometerPin);
int brightness = map(potValue, 1, 10, 1, 255);
if (brightness < 1) {
brightness = 1;
}
if (brightness > 255) {
brightness = 255;
}
analogWrite(ledPin, brightness);
}