int var_pin = A0 ;
int led_pin = 13; // Permet d'utiliser la LED interne
int val_var = 0;
int val = 0;
void setup() {
pinMode(led_pin, OUTPUT);
pinMode(var_pin, INPUT);
}
void loop() {
val_var = analogRead(var_pin);
val = map(val_var, 0, 1023, 0, 255);
analogWrite(led_pin, val);
}