#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C LCD = LiquidCrystal_I2C(0x27, 16, 2);
void setup() {
// put your setup code here, to run once:
LCD.begin(16, 2);
pinMode(8, INPUT);
pinMode(A0, INPUT);
pinMode(7, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
while(digitalRead(8) == HIGH);
int ido = map(analogRead(A0), 0, 1023, 1, 600);
while(ido > 0) {
LCD.setCursor(0,0);
LCD.print(" ");
LCD.setCursor(0,0);
LCD.print(ido);
delay(1000);
ido--;
if(ido == 0) {
digitalWrite(7, HIGH);
LCD.clear();
LCD.print("LEJART-AZ-IDO");
delay(2000);
digitalWrite(7, LOW);
}
if(digitalRead(8) == LOW) {
break;
}
}
LCD.clear();
}