#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C ecranLCD(0x27, 16, 2);
#define POTEN A3
const int MIN_POT = 0;
const int MAX_POT = 1023;
const int MIN_VOL = 0;
const int MAX_VOL = 10;
void setup() {
ecranLCD.begin(16, 2);
ecranLCD.backlight();
ecranLCD.print("Valeur : ");
ecranLCD.setCursor(0,1);
ecranLCD.print("Volume : ");
ecranLCD.setCursor(0,3);
}
void loop() {
int valeurPoten = 0;
valeurPoten = analogRead(POTEN);
int valeurVolume = map(valeurPoten, MIN_POT ,MAX_POT, MIN_VOL, MAX_VOL);
ecranLCD.setCursor(8,1);
ecranLCD.print(valeurVolume);
ecranLCD.print(" ");
ecranLCD.setCursor(8,0);
ecranLCD.print(valeurPoten);
ecranLCD.print(" ");
}