const int DELAI = 250;
const int VITESSE_UART = 9600;
#define MIN_POT 0
#define MAX_POT 1023
#define MIN_VOL 0
#define MAX_VOL 255
void setup() {
Serial.begin(VITESSE_UART);
}
void loop() {
int valeur_Pot = analogRead(A0);
int valeur_Volume = map(valeur_Pot, MIN_POT, MAX_POT, MIN_VOL, MAX_VOL);
// Conversion 0 à 1023 -> 0 à 10
// map(1,2,3,4,5);
// 1= valeur pot, 2= minimum pot, 3 = maximum pot, 4= minimum voulu, 5= maximum voulu
Serial.print("\nValeur du potentiometre = ");
Serial.print(valeur_Pot);
Serial.print("\nLe volume du systeme de son est a: ");
Serial.print(valeur_Volume);
delay(DELAI);
}