/*
Exercice 3 : écran LCD
Proposer un programme et un montage constitué d’un potentiomètre,
Proposez un programme et un montage permettant de connaître son état.
Affichage de son état sur un écran LCD
Fait le 06/11/2024, finit le 13/11/2024
Fonctionne : OUI
*/
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 20, 4);
const int potentiometre = A0;
void setup() {
lcd.begin(16, 2);
// you can now interact with the LCD, e.g.:
Serial.begin(9600);
pinMode(potentiometre, INPUT);
lcd.print("Valeur potentiometre :");
}
void loop() {
int value = analogRead(potentiometre);
lcd.setCursor(1,1);
lcd.print(value);
delay(200);
lcd.clear();
}