//Clignote en fonction du potentiomètre
#include <LiquidCrystal.h>
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
int Potence = A5;
int SwitchPin = 13;
int SwitchPin2 = 8;
int val = 600;
int valS = LOW;
int valS2 = LOW;
String txt = "HELLO, WORLD";
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
lcd.begin(16, 2);
pinMode(SwitchPin, INPUT);
pinMode(SwitchPin2,INPUT);
}
void loop() {
val = analogRead(Potence);
valS = digitalRead(SwitchPin);
valS2 = digitalRead(SwitchPin2);
if (valS == HIGH) {
lcd.noDisplay();
}
else if (valS2 == HIGH){
lcd.display();
lcd.print(txt);
lcd.setCursor (0, 0);
}
else{
lcd.display();
lcd.setCursor(0, 0);
lcd.print(txt);
lcd.setCursor(0, 1);
lcd.print(val);
delay(val);
lcd.clear();
delay(val);
}
}