#include <LiquidCrystal.h>
int rs = 12, e = 11, d4 = 10, d5 = 9, d6 = 8, d7 = 7, pot = A0;
LiquidCrystal lcd(rs, e, d4, d5, d6, d7);
void setup() {
lcd.begin(16, 2);
}
void loop() {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Sanchez #77151");
int valorPotenciometro = analogRead(pot);
int porcentajeLuz = map(valorPotenciometro, 0, 1023, 0, 100);
lcd.setCursor(0, 1);
lcd.print("Luz=");
lcd.print(porcentajeLuz < 10 ? " " : "");
lcd.print(porcentajeLuz);
lcd.setCursor(8, 1);
lcd.print("temp=");
int temperatura = 100 - porcentajeLuz;
lcd.print(temperatura < 10 ? " " : "");
lcd.print(temperatura);
delay(200);
}